开发者

$('*').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 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

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜