Mon, May 17, 2021
 
https://devcodepro.comdevcodepro
X
Home · Latest · Trends  /  JavaScript
1

Switch two div jQuery

jQuery(function(){ 
        jQuery('.showsinglediv').click(function(){
              jQuery('#divfirst').toggle();
              jQuery('#divsecond').toggle();
        });
});

//<a class="showsinglediv">Click</a>
//<div id="divfirst">First Div</div>
//<div id="divsecond" style="display: none">Second Div</div>
rated 1 times (1) (0)
comments: 0 / hits: 126  / 6 months ago, tue, nov 24, 20, 08:31:52
More From » JavaScript
 

Comments

There are no comments for this Snippet yet
Only authorized users can post. Please sign in first, or register a free account
 
Share
Posted
pport
Member since Dec 11, 2019
Total Code Snippets: 7
Total Comments: 0
Location: Hartford, Connecticut
pport snippets
1 year ago, wed, dec 11, 19, 10:46:24
comments: 0 / hits: 2723
PHP
1 year ago, thu, dec 26, 19, 1:40:52
comments: 0 / hits: 1347
1 year ago, wed, feb 12, 20, 2:14:06
comments: 0 / hits: 1844
6 months ago, tue, nov 24, 20, 8:40:57
comments: 0 / hits: 226
CSS
5 months ago, sun, jan 3, 21, 3:39:57
comments: 0 / hits: 114
CSS
5 months ago, mon, jan 4, 21, 11:38:12
comments: 0 / hits: 98