Tryit Editor v2.3

Edit This Code:
<!DOCTYPE html> <html> <body> <button id="btn1" type="button">HTML</button> <p>Click the "Try it" button to return the type of the "HTML" button:</p> <button onclick="myFunction()">Try it</button> <p id="demo"></p> <script> function myFunction() { var x = document.getElementById("btn1").type; document.getElementById("demo").innerHTML = x; } </script> </body> <!-- Mirrored from www.w3schools.com/js/tryit.asp?filename=tryjs_button_type by HTTrack Website Copier/3.x [XR&CO'2014], Fri, 23 Jan 2015 07:36:49 GMT --> </html>
Result:
Try it Yourself - © w3schools.com