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");