This is my html code:
<!DOCTYPE html>
<html>
<head>
<script>
function Check(e) {
var text=document.getElementById("text");
var inputnum = document.getElementById("number");
if (e.value == "option1") {
inputnum.min = "5";
inputnum.max = "10";
text.innerHTML ="input the value from 5 to 10";
} else if (e.value == "option2") {
inputnum.min = "20";
inputnum.max = "30";
text.innerHTML ="input the value from 20 to 30";
}
}
</script>
</head>
<body>
<select id="selectMe" onChange="Check(this);">
<option value=""></option>
<option value="option1">option1</option>
<option value="option2">option2</option>
</select>
<br><br><br>
<input name="number" type= "number" id="number">
<p id="text"></p>
</input>
</body>
</html>
I need little modification in this code which sets the minimum and maximum value of the number input box as per the option selected from drop down.
For eg: If user selects option1 then the minimum value must be 5 and maximum most be 10. Similarly If user selects option2 then the minimum value must be 10 and maximum most be 20. And it also should show the message (inside html below the text box (not as alert message) showing please input the value from xxx to xxx
Please help me with this. thankyou in advance.
`
– Simone Rossaini Jul 07 '20 at 10:10