Guest User

Untitled

a guest
Jul 19th, 2018
64
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.64 KB | None | 0 0
  1. <!DOCTYPE html>
  2. <html>
  3. <head>
  4. <title>Page Title</title>
  5. </head>
  6. <body>
  7. <form>
  8. First name:<br>
  9. <input type="text" id = "text" name="firstname">
  10. </form>
  11. <button type="button" id ="Submit">Submit!</button>
  12.  
  13. </body>
  14. <script>
  15. document.getElementById("Submit").onclick = function(){
  16. var a = "'a', 'b', 'c'";
  17. var enter = document.getElementById("text").value;
  18. a.toString();
  19. if (a == enter){
  20. alert("congrats");
  21. }
  22. else if(enter == null){
  23. alert("you put nothing");
  24. }
  25. else if (enter != a){
  26. alert("wrong try again")
  27. }
  28. else{
  29. alert("End of if statment")
  30.  
  31. }
  32.  
  33. }
  34. </script>
  35. </html>
Add Comment
Please, Sign In to add comment