1. Simplest Method <script> $(document).ready(function(){ $("button.demo").click(function(){ $(this).parent().find('p').slideToggle("slow"); }); }); </script> HTML <div class="main"> <button class="demo">Toggle slideUp() and slideDown()</button> <p>This is a paragraph.</p> </div> <div class="main"> <button class="demo">Toggle slideUp() and slideDown()</button> <p>This is a paragraph.</p> </div> <div class="main"> <button class="demo">Toggle slideUp() and slideDown()</button> <p>This is a paragraph.</p> </div> 2. Second example <script type="text/javascript"> jQuery(document).ready(function($) { // Find the toggles and hide their content $('.toggle').each(function(){ $(this).find('.toggle-content...
Coding Cheatsheets - Learn web development code and tutorials for Software developers which will helps you in project. Get help on JavaScript, PHP, XML, and more.