I have <select id="someid"></select>
I then click something and jquery.ajax generates new div and attach .html(data) to #someid select. How do I check for change in select?
The reason why I am asking is that I start with empty selects and load them with data related to one record.
There are two selects, select1 and select2. I generate select1 just once and based on selected option from开发者_高级运维 select1 then I generate select2. I need to track if select1 has not been changed and whether I need to regenerate select2. Currently it doesnt do anything $("#select1").change(alert('test')) starts immediately after running the page but wont do anything after another change. It just wont run.
Is this possible?
Thanks.
If ive read the question right, this is very easy using .change()
$('select#someid').live('change', function() {
// you code
});
精彩评论