Run Code  | Code Wall  | Users  | Misc  | Feedback  | About  | Login  | Theme  | Privacy 

HTML5 Button

 run  | edit  | history  | help 1


  by  DmilkaSTD, 9 months 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, 7 months ago

child example

  by  mikerz, 4 months ago

Please log in to post a comment.