Tryit Editor v2.3

Edit This Code:
<!DOCTYPE html> <html> <body> <p>Input your age and click the button:</p> <input id="age" value="18" /> <button onclick="myFunction()">Try it</button> <p id="demo"></p> <script> function myFunction() { var age,voteable; age = document.getElementById("age").value; voteable = (age < 18) ? "Too young":"Old enough"; document.getElementById("demo").innerHTML = voteable + " to vote."; } </script> </body> <!-- Mirrored from www.w3schools.com/js/tryit.asp?filename=tryjs_comparison by HTTrack Website Copier/3.x [XR&CO'2014], Fri, 23 Jan 2015 07:35:58 GMT --> </html>
Result:
Try it Yourself - © w3schools.com