Reputation: 3
I'm trying to capture the change of the drop list, however the click and change event didn't work no matter in ff or chrome. Here's the source html code:
<select class="select" id="querycond_select_Baitgenesymbol" style="max-width: 400px">
<option>APC</option>
<option>CTNNB1</option>
<option>DNMT1</option>
<option>ELF3</option>
<option>EPHB2</option>
<option>MRE11</option>
and jQuery:
$('.select').click(function() {
alert("!!!!!!!")
});
I also tried to replace the click with change, but it didn't work out for me too.
Upvotes: 0
Views: 3601
Reputation: 764
works just fine ... http://jsfiddle.net/tXy6Q/ try adding it in document.ready()
if the select box is added dynamically based on logic would recommend using live() method..
use the change event rather than click
also check for any errors using firefox error console ..
Upvotes: 1
Reputation: 382776
Make sure to:
ready
handlerchange
instead of click
$(function(){
$('#querycond_select_Baitgenesymbol').change(function() {
alert("!!!!!!!");
});
});
Upvotes: 2
Reputation: 46057
Try this:
$(function(){
$("#querycond_select_Baitgenesymbol").change(function(e){
alert("here");
});
});
Upvotes: 0