CodeLab
Tutorials For Everyone
Run
Learn jQuery
<!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8"> <title>Click To Hide Buttons</title> <style> body { display: flex; flex-direction: column; align-items: center; justify-content: center; min-height: 100vh; margin: 0; background-color: #f0f0f0; } h1 { color: #2c3e50; margin-bottom: 20px; font-size: 2.2em; text-shadow: 2px 2px 5px rgba(0,0,0,0.2); text-align: center; } .button-container { display: flex; justify-content: center; flex-wrap: wrap; margin-top: 50px; } .button { display: inline-flex; align-items: center; justify-content: center; padding: 14px 28px; border: none; border-radius: 10px; background-image: linear-gradient(to bottom right, #686de0, #4834d8); color: white; font-size: 18px; font-weight: bold; cursor: pointer; margin: 10px 15px; box-shadow: 0 4px 8px rgba(0,0,0,0.3); transition: background-image 0.3s ease, transform 0.2s ease, box-shadow 0.3s ease; } .button:hover { background-image: linear-gradient(to bottom right, #757de8, #5e46e0); transform: translateY(-3px); box-shadow: 0 6px 12px rgba(0,0,0,0.3); } .show { display: none; background-image: linear-gradient(to bottom right, #ff3300, #3399ff); } .button.show:hover { background-image: linear-gradient(to bottom right, #ff2200, #1199ff); } @media (max-width: 500px) { .button-container { flex-direction: column; } .button { margin: 15px 0; max-width: 300px; font-size: 14px; } } </style> </head> <body> <h1>Click to Hide Buttons</h1> <div class="button-container"> <button class="button action">Click Me</button> <button class="button action">Try Me</button> <button class="button action">Press Me</button> <button class="button show">Show Buttons</button> </div> <script> $(document).ready(function(){ $('.button.action').click(function(){ $(this).hide(); if ($('.button.action:visible').length === 0) { $('h1').text('All Buttons are Hidden.'); $('.button.show').show(); } }); $('.button.show').click(function(){ $('.button.action').show(); $('h1').text('Click to Hide Buttons'); $(this).hide(); }); }); </script> </body> </html>
Editor Commands
Ctrl
F
Find
Ctrl
G
Find Next
Ctrl
⇧
G
Find Previous
Ctrl
⇧
F
Find & Replace
Ctrl
]
Indent Code Right
Ctrl
[
Indent Code Left
⇧
Tab
Auto Indent Code
Ctrl
/
Line Comment
Ctrl
Alt
/
Block Comment
TutsInsider Actions
Alt
S
Run Code
Ctrl
C
Copy Editor Code
Ctrl
A
Select All Editor Code
Ctrl
S
Save/Download
Ctrl
Alt
X
Rotate
Ctrl
Alt
T
Switch Theme
Ctrl
⇧
C
Open Console
Esc
Close Console