Deprecated: mysql_connect(): The mysql extension is deprecated and will be removed in the future: use mysqli or PDO instead in /home/myscript/public_html/codes-snippets/config.php on line 6
Jquery Multiple Css Example - Jquery

Jquery Multiple Css Example - Jquery

How to add multiple css attributes in jquery?

Snippet Code


  
Rate this page :
  [ 0 votes]

Simple jquery multiple css code which allows to set the multiple css properties for selected elements. The sample code to set css properties is given below.

<script src="http://code.jquery.com/jquery-1.9.1.js"></script> <script> $(document).ready(function(){ $("#btn").click(function(){ $("p").css({"background-color": "yellow", "font-size": "1.5em", "color": "red"}); }); }); </script> <div align='center'> <p> Welcome to Hscripts Snippets!!! </p> <input type='button' id='btn' value='Click'> </div>

Tags


Ask Questions

Ask Question