jquery Property Selector

Source: Internet
Author: User

<body>
<div id= "Div1" class= "Box1 box2" title= "Hello" >aaaaa</div>
<input type= "text" value= "123_444" >
<input type= "text" value= "456_555" >
<input type= "text" value= "123_555" >
</body>

$ (' input[value] ')//Select input with the value attribute

$ (' input[value=123] ') selects input with value 123

$ (' input[value^=123] ') value starting with 123 input

$ (' input[value$=555] ') input with 555 at the end of value

$ (' input[value*=333] ') value contains 3 of input

$ (' input[name~= "man"] ') the name value is separated by a white space character, and there is a man input in the word, for example: <input name= "Milk man"/>

$ (' input[name!= ' newsletter "] ') name is not equal to newsletter input, but this property selector is a selector extended by jquery, not a specification of CSS, using the [name!=" value "] does not take full advantage of the native Dom's Queryselectorall method to improve performance, so in order to improve the performance of modern browsers, you can use $ (). Not (' name!= ' value ') instead

jquery Property Selector

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.