This is dangerous because it is not going to be properly scoped to the component. Meaning that it may pick up elements that are outside of the component. You should try to figure out why it is not working. Probably because of when it is called. Maybe you need to wait for a specific event to occur. At the very least you should scope the jQuery search to the components container.