Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <!DOCTYPE html>
- <html>
- <head>
- <meta charset="UTF-8">
- <title>Xd xd XD xD</title>
- </head>
- <body>
- <h1>Podaj imie</h1>
- <form>
- Podaj imie:<input id="imie" type="text">
- <input type="button" onclick="walidacja()" value="wyslij">
- </form>
- <h3 id="wynik"></h3>
- <script>
- function walidacja(){
- wyrReg=/^[A-Z]{1}[a-z]{2,}$/;
- imie=document.getElementById("imie").value;
- if(wyrReg.test(imie)) document.getElementById("wynik").innerHTML="ok";
- else document.getElementById("wynik").innerHTML=":(";
- }
- </script>
- </body>
- </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement