Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.

CANEHDN

macrumors 6502a
Original poster
Dec 12, 2005
855
0
Eagle Mountain, UT
Hey guys. Have a question about jQuery. Here is what I'm doing.

I have a dropdown. When someone selects an option from the dropdown, jquery pulls some info from another file and displays it on the page. This works fine. This other file contains a div with an id. I then want to perform an action with that id, using jQuery. Since the id isn't present on the page during load, jQuery doesn't see any action performed on the id placed after the page loaded.

The id is; id="checkStockNum".
My jQuery is:
Code:
$("#checkStockNum.click(function () { alert("test"); });

How do I get the id to be recognized by jQuery after the page has loaded and once it's placed on the page. I hope that makes sense. I'm not even sure how to google this.

Any help would be greatly appreciated.
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.