Run Code  | API  | Code Wall  | Users  | Misc  | Feedback  | Login  | Theme  | Privacy  | Patreon 

HTML5 Button

 run  | edit  | history  | help 2


  by  DmilkaSTD, 3 years ago

<!DOCTYPE html> <html> <style> body{ color:white; font-family:arial; text-align:center; }


#btn{ background-color: #4CAF50; border: none; color: white; padding: 15px 32px; text-align: center; text-decoration: none; display: inline-block; font-size: 16px; margin: 4px 2px; cursor: pointer; }



<h1 style="text-align:center">Button test</h1>

Testing button things :V

Click the button to give it a try!

<button id="btn" onclick="disappear()">Click me</button>

<h3 id="demo"; style="color:blue">

<script> var clickme = true; function disappear() { if (clickme){ clickme = false; document.getElementById("demo").innerHTML = "It works! Click the button again to remove this text."; }else{ document.getElementById("demo").innerHTML = ""; clickme = true; } } </script>

</body> </html>

  by  morgas, 3 years ago

child example

  by  mikerz, 2 years ago

Please log in to post a comment.