-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathM3L5.html
28 lines (27 loc) · 830 Bytes
/
M3L5.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta http-equiv="X-UA-Compatible" content="ie=edge">
<title>Document</title>
</head>
<body>
<p>enter a number and click oke </p>
<input id="id1" type="number" min="100">
<button type="button" onclick="myFunction()">oke</button>
<p>if the number is less tan 100 (the input mins atribut), an error message wil be displayed</p>
<p id="demo"></p>
<script>
function myFunction(){
var txt = "";
if(document.getElementById("id1").validity.rangeUnderFlow){
txt = "Value too small";
}else{
txt = "input oke"
}
document.getElementById("demo").innerHTML = txt ;
}
</script>
</body>
</html>