Run a script once an element changes
How w开发者_如何学Pythonould I monitor an element, for example a picklist or updated form object, for any changes and then code once any change occurs?
$('#element-id').live('eventType', function(e) {
//do stuff here
});
The 'eventType' will be different based on the type of object '#element-id' is.
http://api.jquery.com/live/
$("#element").change(function(){
//do your stuff
});
will probably do it
By using jQuery's change
method.
$('#element').change(function(){
// ...
});
精彩评论