their is some problem of click event in 开发者_如何学运维chrome
<select id="id-name" name="name-her">
<option value="">Select</option>
<option value="1" class="verify">Verify</option>
<option value="2" class="delete">Reject</option>
</select>
$('.verify').bind("click", function( evt ){
alert('clicked');
});
$('.delete').bind("click", function( evt ){
alert('clicked');
});
here we want to initiate two events on the basis of class which one is clicked, It works fine in firefox but not in chrome.
Any suggestion please ?
<select id=”category”>
<option value=”3″ onclick=”getOption(3);”>Option1</option>
</select>
This works fine in Firefox, i.e. the function ‘getCategories’ gets called when choosing an object in the select box. This does not work for the other browsers though, the calls are not made and there are even no errors raised.
The solution is to make the function call on the select-tag instead using the onchange-event referencing the value of the select tag (which will hold the value of the chosen option-tag),
<select id="category" onchange="getOption($('category').val());">
<option value="3">Option1</option>
</select>
精彩评论