Pages

Subscribe:

Ads 468x60px

Sunday, March 25, 2012

How to use IF Else Condition to show hide div using Jquery

In this Web Programming tutorial we will learn that how we can use IF and ELSE Condition in Jquery to show or Hide an element on a web form. below is the code:
HTML Button Code:

Below code will check if Div element is hidden than it will make it show else it will nake it hidden.
Code for JQuery:
$('#toggleButton').click(function() {
if ($('#disclaimer').is(':visible')) {
$('#disclaimer').hide();
} else {
$('#disclaimer').show();
}
});

No comments:

Post a Comment