开发者

$('*').not('input') doesn't work for password fields in chrome?

开发者 https://www.devze.com 2023-02-17 01:18 出处:网络
I am selecting all tags that are not input tags to bind a hotkey to. $(\'*\').not(\'input\').bindHotKey(blah);

I am selecting all tags that are not input tags to bind a hotkey to.

$('*').not('input').bindHotKey(blah);

However, this doesn't seem to excl开发者_开发百科ude the password field in chrome. ie: <input type="password"/>


Try to only select the descendants of the body element:

$('body *').not('input').bindHotKey(blah);

DEMO

Update: But it even seems to work with $('*'). Have a look at this fiddle. Without not there are 11 elements in the page, with not, 10.

0

精彩评论

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