1 <!DOCTYPE HTML Public "-//W3C//DTD XHTML 1.0 transitional//en" "http://www.w3.org/TR/xhtml1/DTD/ Xhtml1-transitional.dtd ">2 <HTMLxmlns= "http://www.w3.org/1999/xhtml">3 <Head>4 <Metahttp-equiv= "Content-type"content= "text/html; charset=utf-8" />5 <title>Index</title>6 <Scripttype= "Text/javascript"src= "Jquery-3.1.1.min.js">7 8 </Script>9 <Scripttype= "Text/javascript">Ten $(function(){ One Console.log ("selector "P[align]" length is:"+$("P[align]"). length); A Console.log ("selector "p[align= ' center ']" length is:"+$("p[align= ' center ']"). length); - Console.log ("selector "p[title= ' Hellohtmlworld ']t" length is:"+$("p[title= ' Hellohtmlworld ']"). length); - Console.log ("selector "p[title^= ' hello ']" length is:"+$("p[title^= ' Hello ']"). length); the Console.log ("selector "p[title$= ' world '" length is:"+$("p[title$= ' World '"). length); - Console.log ("selector "p[title*= ' html ']" length is:"+$("p[title*= ' html ']"). length); - Console.log ("selector "p[title~= ' hello ']" length is:"+$("p[title~= ' Hello ']"). length); - Console.log ("selector "p[title|= ' hello ']" length is:"+$("p[title|= ' Hello ']"). length); + Console.log ("selector [href^= ' http '][title= ' Hello-html-world '] "length is:"+$("[href^= ' http '][title= ' Hello-html-world ']"). length); - } + ); A </Script> at </Head> - <Body> - <Div> - <PAlign= "Center">Hello world!</P> - <PAlign="">Hello world!</P> - </Div> in <Divclass= "Test"ID= "Test"Align=""style= "Background-color: #CCCCCC"> - <Pclass= "Test"title= "Hello">Hello world!</P> to <Pclass= "Test"title= "Hello HTML World">Hello world!</P> + <Pclass= "Test1"title= "Hellohtmlworld">Hello world!</P> - <Pclass= "Test1"title= "Hello-html-world">Hello world!</P> the <aclass= "Test1"title= "Hello-html-world"href= "http://www.cnblogs.com/yw0219/p/5928955.html">jquery Selector</a> * </Div> $ </Body>Panax Notoginseng </HTML>
Results:
Demo-jquery Property Selector