开发者

jquery function call

I bound the blur function to 开发者_开发技巧a text box having class name 'qtyToPick'. Now I want to call the same blur function if I change checked property of a check box having class 'chkSelect'.

How can i do it ?

$('.qtyToPick').live('blur', function() {
    //  Code here
});


Define the function separately, and bind it to the appropriate events for the appropriate elements:

var theFunc = function() { /* Code here */ };

$( '.qtyToPick' ).live( 'blur', theFunc );
$( '.chkSelect' ).live( 'change', theFunc );


$('#chkSelect').change(function() {

   $('.qtyToPick').blur();

});
0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜