jQuery Tutorial
$(selector).css(PropertyName, PropertyValue);
<html> <head> <script src="https://code.jquery.com/jquery-1.9.1.min.js"></script> <script> $(document).ready(function() { $( "div" ).css("color", "blue"); }); </script> </head> <body> <div>Welcome to jQuery learning!</div> </body> </html>Output:
Welcome to jQuery learning!
$(selector).css({PropertyName1:PropertyValue1, PropertyName2:PropertyValue2, ...});
<html> <head> <script src="https://code.jquery.com/jquery-1.9.1.min.js"></script> <script> $(document).ready(function() { $( "div" ).css({"color": "blue", "font-weight": "bold"}); }); </script> </head> <body> <div>Welcome to jQuery learning!</div> </body> </html>Output:
Welcome to jQuery learning!
$(selector).css(property_name);
<html> <head> <script src="https://code.jquery.com/jquery-1.9.1.min.js"></script> <script> $(document).ready(function() { document.write($( "div" ).css("color")); }); </script> </head> <body> <div style="color: blue;">Welcome to jQuery learning!</div> </body> </html>Output:
rgb(0, 0, 255)
jQuery Tutorial
Privacy Policy | Copyright2020 - All Rights Reserved. | Contact us
| Report website issues in Github
| Facebook page
| Google+ page