sudhakarinfotech
(current)
Run Code
Live Code Editor- jQuery Toggle
Source Code
<!DOCTYPE html> <html lang="en"> <head> <meta charset="utf-8"> <meta name="viewport" content="width=device-width, initial-scale=1.0"> <title>jQuery Show And Hide Effects</title> <script src="https://code.jquery.com/jquery-3.5.1.min.js"></script> <style> p{ padding:20px; background: green; color:white; font-size:25px; } .btn-toggle-efefct{ padding:10px 15px; background-color:black; color:white; border:none; border-radius:5px; margin:15px 10px; } </style> <script> $(document).ready(function(){ $(".btn-toggle-efefct").click(function(){ $("p").toggle(2000); }); }); </script> </head> <body> <h1>jQuery Toggle</h1> <button type="button" class="btn-toggle-efefct">Jquery Toggle Method</button> <p>This is first paragraph text.</p> <p>This is second paragraph text.</p> </body> </html>
Source Code Output :
Running