0% found this document useful (0 votes)
5 views1 page

jQuery CSS Manipulation Guide

This document discusses jQuery, a JavaScript library used to simplify HTML document manipulation. It provides an example of using jQuery to make a paragraph disappear when clicked. It then discusses the jQuery css() method, which can be used to get or set CSS properties. The css() method has three syntaxes - to return a single CSS property value, set a single property value, or set multiple property values at once.

Uploaded by

Jyoti Rajput
Copyright
© Attribution Non-Commercial (BY-NC)
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
5 views1 page

jQuery CSS Manipulation Guide

This document discusses jQuery, a JavaScript library used to simplify HTML document manipulation. It provides an example of using jQuery to make a paragraph disappear when clicked. It then discusses the jQuery css() method, which can be used to get or set CSS properties. The css() method has three syntaxes - to return a single CSS property value, set a single property value, or set multiple property values at once.

Uploaded by

Jyoti Rajput
Copyright
© Attribution Non-Commercial (BY-NC)
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd

jQuery

<!DOCTYPE html> <html> <head> <script type="text/javascript" src="[Link]"></script> <script type="text/javascript"> $(document).ready(function(){ $("p").click(function(){ $(this).hide(); }); }); </script> </head> <body> <p>If you click on me, I will disappear.</p> </body> </html>

jQuery css() Method


jQuery has one important method for CSS manipulation: css() The css() method has three different syntaxes, to perform different tasks.

css(name) - Return CSS property value css(name,value) - Set CSS property and value css({properties}) - Set multiple CSS properties and values

Return CSS Property


Use css(name) to return the specified CSS property value of the FIRST matched element:

Example
$(this).css("background-color");

You might also like