jQuery – Hide consecutive DIV’s

Wanted to hide 2 consecutive DIV tags in my form. I could have given unique ID’s to those div’s and hidden them. But it was really not required. I gave an ID to the first DIV that served as a header and the next sibling DIV was the container for data. Here’s what I did after giving an ID to the header DIV:

$div_ec = $( "#id_feature_ec" );
$div_ec.hide(500); $div_ec.next().hide(500);
Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s