Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <!DOCTYPE html>
- <html>
- <head>
- <title>Page Title</title>
- </head>
- <body>
- <form>
- First name:<br>
- <input type="text" id = "text" name="firstname">
- </form>
- <button type="button" id ="Submit">Submit!</button>
- </body>
- <script>
- document.getElementById("Submit").onclick = function(){
- var a = "'a', 'b', 'c'";
- var enter = document.getElementById("text").value;
- a.toString();
- if (a == enter){
- alert("congrats");
- }
- else if(enter == null){
- alert("you put nothing");
- }
- else if (enter != a){
- alert("wrong try again")
- }
- else{
- alert("End of if statment")
- }
- }
- </script>
- </html>
Add Comment
Please, Sign In to add comment