Prevent onblur code to execute if clicked on submit button

前端 未结 3 1464
长情又很酷
长情又很酷 2021-02-04 12:15

By the following code I wish to \"DO SOMETHING\" on \"ONBLUR\" of element id=\"eg1\" only if the onblur event was not caused due to \"ONCLICK\" on the submit button.

<         


        
3条回答
  •  谎友^
    谎友^ (楼主)
    2021-02-04 12:48

    Update:

    $('input[type="submit"]').mousedown(test);

    Have a look at this fiddle JSFiddle to address your problem. Use the console to view the events triggered and suppressed after specific actions are performed.

    You should suppress the event handler that is bound to the text when click or submit is performed.

提交回复
热议问题