Jquery event chaining

前端 未结 2 971
难免孤独
难免孤独 2020-12-09 23:26

Based on this question

I don\'t want to litter my ready stuff waiting for a \"click event\" AND a \"change event\" AND a \"mouseover event\" I want to have all that

2条回答
  •  甜味超标
    2020-12-09 23:48

    I think you are looking for bind. Bind can wire multiple events to the same function using a single call instead of using a chain:

    $("textarea.checkMax").bind("keyup mouseover", checkMaxLength);
    

提交回复
热议问题