Effect:
Core code:
CopyCode The Code is as follows: <SCRIPT type = "text/JavaScript">
Certificate ('{one'}.css ("background", "# fff ");
Certificate ('div'0000.css ("background", "# fff ");
$ ('Body div'hangzhou.css ("background", "# bbffaa"); // you can change the attributes of all the divs in the body.
$ ('Div> span'background .css ("background", "# bbffaa" ).css ("color", "Red" ).css ("font-size", "12px "); // change the attribute of the span element under all Div
$ ('# Two> .mini').css ("background", "Red"); // all the classes in the DIV whose ID is two are attributes of mini Elements
$ ('# Two'). siblings ("Div" ).css ("color", "green"); // select the # two peer Div element, regardless of the front and back positions
$ ('Div: first'background .css ("background", "Red ");
$ ('Div: gt(1'hangzhou.css ("background", "# fff"); // All DIV elements whose index value is greater than 1
$ ('Div: lt(1'' background .css ("background", "yellow ");
$ ('Div: not(.one+'0000.css ("color", "# cccccc"); // change the DIV element whose class is not one.
$ ('Div: even'0000.css ("font-size", "15px"); // Div with an even Index Number
$ ('Div: odd'0000.css ("font-size", "12px"); // Div with an odd Index Number
$ ('Div: contains(otherw.'hangzhou.css ("font-size", "10px"); // you can specify the DIV element containing the text other.
$ ('Div: has(.mini}'}.css ("color", "# bbffaa"); // you can specify the background color of the <div> element containing the class as the mini element.
$ ('Div: parent'0000.css ("color", "# ffcccc"); // you can change the attributes of a div element containing child elements (including text ).
$ ('Div: Den den '). Show (3000); // obtain the hidden Div
$ ('Div: visable') // obtain the visible Div
$ ("Div [Title = test]" ).css ("background", "black"); // sets the DIV whose title is test.
$ ("Div [. Mini] [Title = test]" ).css ("color", "Red"); // sets the DIV whose class is Mini title and test.
</SCRIPT>
Full DEMO code:Xmlns = "http://www.w3.org/1999/xhtml">
ID: One Class: One
Class: miniclass: Mini, Title: otherclass: Mini, Title: testclass for Mini, title for test
The span under DivStyle for display none's Div