Tuesday, February 12, 2013

Apply style(CSS) to HTML Elements using Jquery

Lets say we need to hide to div tag on the page using CSS and Jquery.

Below is a Jquery code with two parameters. First parameter specifies the style property and the second parameter accepts the value of the property.

function hideDiv()
    $("#divHiddenPrint").css("display", "none");
HTML Code.
<div id="divHiddenPrint"></div>
Call the function on the button click event.
<input type="button" value="Print" onclick="hideDiv()"/>

No comments:
Write comments
Recommended Posts × +