<! DOCTYPE html>"UTF-8"> <title> access and set element styles </title> <script src="Js/jquery.js"></script> <style>. divstyle{border:5px Solid black; Background-color:silver; }. Trstyle{background-color:lightskyblue;; color:black; } . </style> <script type="Text/javascript">//page loading complete shorthand form$ (function () {//Set cell width 100px //$ ("td"). css ("width", "300px"); //$ ("td"). css ("font-size", "30px"); //$ ("td"). css ("color", "red"); //$ ("td"). CSS ("border", "1px solid red"); $("TD"). CSS ({"width":"300px","font-size":"30px","Color":"Red","Border":"1px solid Red"}) //gets the div background color, css can set element properties, can also get CSS properties varColor= $ ("Div"). CSS ("Background-color"); Alert (color); //Set zebra crossing, alternating background color to blue, font to black odd even lines, if you set multiple classes plus, number separated$("tr:odd"). addclass ("Trstyle"); //Move out the CSS style of the corresponding element, move out of the Div's style, or move out of all CSS styles if no arguments are worn$("Div"). Removeclass ("Divstyle"); }) </script> class="Divstyle"> <table> <tr><td> user name 1</td><td> password 1</td></tr> <tr><td> User name 2</td><td> password 2</td></tr> <tr><td> username 3< ;/td><td> password 3</td></tr> <tr><td> user name 4</td><td> password 4</td>< /tr> <tr><td> user name 5</td><td> password 5</td></tr> <tr>< ;td> User name 6</td><td> password 6</td></tr> <tr><td> username 7</td><td> password 7& lt;/td></tr> <tr><td> username 8</td><td> password 8</td></tr> <tr><td> User name 9</td><td> password 9</td></tr> <tr><td> username 10</td> ;<td> password 10</td></tr> </table> </div> </body> jquery learning-set Access element styles