Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <!DOCTYPE html>
- <html>
- <head>
- </head>
- <body>
- <p>Please input a number between 1 and 10:</p>
- <input id="numb" type="text">
- <button type="button" onclick="myFunction()">Submit</button>
- <p id="demo"></p>
- <script>
- function myFunction() {
- var x , text;
- x=document.getElementById("numb").value;
- if(isNaN(x) || x < 10 || x > 10)
- {
- text = "Input not valid";
- }
- else
- {
- text = "Input okey"
- }
- document.getElementById("demo").innerHTML=text;
- }
- </script>
- </body>
- </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement