JQuery, add two handlers for the same event
I have several text inputs in my page. They have different classes added to them. Depending on the class they each have, I add开发者_如何学运维 an onchange event handler. Everything worked OK, until they all shared one common class, then I add common onchange handler again. The first oen gets overwritten.
Is there a way to add another handler and not overwrite the precious one?
They should not get overwritten.
You should be able to do:
$('.className').change(function(){
alert('here')
})
$('.className').change(function(){
alert('over here')
})
And you should see both alerts
See fiddle: http://jsfiddle.net/maniator/JEyTM/
All right, I resolved my issue following this tutorial.
It was actually related to a this Farbtastic bug
精彩评论