0
How can i change background of a input with type of number when it's value is more than 100 or less than 1 . I want to use css.
2 Respostas
+ 1
You can't with css as far as I know ,but you can use js to do easily
var input=document.querySelectot("input[type=number]");
input.oninput=(e)=>{
If(e.target.value>100){
e.target.backgroundColor="red";
}
}
0
You have to use js as suggested
by Abhay
Css is use to design elements not to validate .
Html 5 have some built-in validation but it not fullfill your condition.