简体   繁体   中英

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

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 exclude 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.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM