html - Hide all other div's using jQuery -


when click button, show div id. want hide other div id's. can point me tutorial on how using jquery? current code given below:

$('#show_link_group').click(function() {   $('#link_group').show(); }); 

after shows #link_group, want hide other div's.

i suggest giving off div's class name , use hide them.

<div class="alert" id="item-one"></div> <div class="alert" id="item-two"></div> <div class="alert" id="item-three"></div> 

then using jquery

// hide divs class of alert show div id of item-one $('.alert').hide().filter('#item-one').show(); 

Comments

Popular posts from this blog

commonjs - How to write a typescript definition file for a node module that exports a function? -

openid - Okta: Failed to get authorization code through API call -

ios - Change Storyboard View using Seague -