jQuery,选择正文但不包括Textarea和Input:Text,如何? [英] jQuery, Select Body but exclude Textarea and Input:Text, how?
问题描述
我尝试了这个$('body').children().not('textarea input:text')
但是没有用.有人有主意吗?
I tried this $('body').children().not('textarea input:text')
But not working. Anyone has an idea?
我想要这个,因为当我使用 jQuery.translator 时,我不会希望textarea
和input:text
进行转换,所以我想排除它们.如果您知道更好的方法,请告诉我.谢谢.
I want this because when I use jQuery.translator, I do not want the textarea
and input:text
get transalted, so I like to exclude them. If you know a better way to do this, let me know. Thanks.
编辑
我认为我问错了一个问题,请在此处检查新问题 不使用jQuery.translator来翻译textarea,如何?
I think I asked a wrong question, please check here for new question Do NOT translate textarea by jQuery.translator, how?
我现在要关闭这个.谢谢
I am going to close this one now. thanks
推荐答案
$('body *:not(textarea, input:text)')
children()
仅给您直接的孩子,并且不太可能在没有某种结构干预的情况下直接在body
下输入元素.另外,'textarea input:text'
表示在 文本区域内的文本输入,(希望)永远不会发生.
children()
only gives you the immediate children, and it's unlikely you have input elements directly under body
without some kind of structure intervening. Also, 'textarea input:text'
means text inputs that are within a textarea, which will (hopefully) never happen.
这篇关于jQuery,选择正文但不包括Textarea和Input:Text,如何?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!