JQuery's css () method and jquerycss Method
Css () method of jQuery
The following code sets multiple style attributes for a div at a time.
<! DOCTYPE html>
<Html>
<Head>
<Meta charset = "UTF-8">
<Title> css3 </title>
<Script src = "js/jquery-1.9.1.min.js"> </script>
<Script type = "text/javascript">
$ (Document). ready (function (){
$ ("# AB" ).css ({
Color: "red ",
FontSize: "16px ",
FontWeight: "bold"
});
});
</Script>
</Head>
<Body>
<Div id = "AB"> 00H5 </div>
</Body>
</Html>
Of course, you can also set a single CSS style as follows:
<! DOCTYPE html>
<Html>
<Head>
<Meta charset = "UTF-8">
<Title> CSS </title>
<Script src = "js/jquery-1.9.1.min.js"> </script>
<Script type = "text/javascript">
$ (Document). ready (function (){
$ ("# AB" ).css ("color", "red ");
});
</Script>
</Head>
<Body>
<Div id = "AB"> 00H5 </div>
</Body>
</Html>