weixin_33717298 2015-06-15 21:46 采纳率: 0%
浏览 16

活动是否模糊并提交?

How can I change the following to submit on both blur and on submit:

$('form').on('blur', 'input', function(event) { });
  • 写回答

3条回答 默认 最新

  • weixin_33690963 2015-06-15 21:49
    关注

    You can pass multiple events to jQuery's on method.

    $('form').on('blur submit', function(event) { })
    

    This would mean that whenever the $('form') element was either a) blurred or b) submitted, the event handler would be invoked.

    评论

报告相同问题?