如何在jquery中更改事件的顺序 [英] How to change order of event in jquery

查看:138
本文介绍了如何在jquery中更改事件的顺序的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有文本框并提交并关闭按钮。在文本框的焦点上有jquery验证。哪个好。但是当用户在文本框中键入内容并直接单击关闭按钮时,我不想进行验证。因为聚焦事件首先被激活所以验证工作。我希望首先触发按钮点击事件。

I am having textbox and submit and close button. There is jquery validation on focusout of textbox. Which is fine. But when user type something in textbox and directly click the Close button i don't want to do validation. As focusout event fired first so validation work. I want button click event to fire first.

推荐答案

检查这个小提琴 [ ^ ]



使用验证器检查这个小提琴 [ ^ ]

我尝试过使用上述查询而不使用focusout事件。请检查其他,回复您的疑问。

谢谢

:)
Check this fiddle[^]

Check this fiddle also using validator[^]
I have tried todo the above query without using focusout event. Please check else, respond back with your queries.
Thanks
:)


这篇关于如何在jquery中更改事件的顺序的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆