Advertisement
Guest User

Untitled

a guest
Nov 22nd, 2017
54
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.52 KB | None | 0 0
  1. <!DOCTYPE html>
  2. <html>
  3. <head>
  4. <meta charset="UTF-8">
  5. <title>Xd xd XD xD</title>
  6. </head>
  7. <body>
  8. <h1>Podaj imie</h1>
  9. <form>
  10. Podaj imie:<input id="imie" type="text">
  11. <input type="button" onclick="walidacja()" value="wyslij">
  12. </form>
  13. <h3 id="wynik"></h3>
  14. <script>
  15. function walidacja(){
  16. wyrReg=/^[A-Z]{1}[a-z]{2,}$/;
  17. imie=document.getElementById("imie").value;
  18. if(wyrReg.test(imie)) document.getElementById("wynik").innerHTML="ok";
  19. else document.getElementById("wynik").innerHTML=":(";
  20. }
  21. </script>
  22. </body>
  23. </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement