开发者

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(){
    // ... 
});
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜