Having trouble with attribute != selector

前端 未结 1 895
名媛妹妹
名媛妹妹 2020-12-11 17:32

The question is simple, the answer maybe not.

I\'m trying to apply several styles to all input elements without an specific id. I use this selector in my CSS stylesh

相关标签:
1条回答
  • 2020-12-11 18:19

    That is a non-standard attribute selector invented by jQuery. It's not part of the Selectors specification, so it won't work anywhere outside of jQuery (this includes things like document.querySelectorAll()).

    Strictly speaking, the direct equivalent of jQuery's input[id!='move'] in standard selector syntax is input:not([id='move']), with an attribute selector. But since you're looking to match elements without a specific ID, input:not(#move) is fine.

    0 讨论(0)
提交回复
热议问题