Hi, I explain, I have 2 input text and I want it in the first one if you have 4 or less characters, you should use the red form and if you have more in yellow
I have it all on the same page and with conditionals if, I thought about while but it becomes infinity and does not let me write, I apologize that I walk something green
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8" />
<title>LOGIN</title>
<script src="Scripts/jquery-3.2.1.js"></script>
<script>
$(document).ready(function () {
if ($("#e1").length <= 4) {
$("#e1").css("background-color", "red");
};
if ($("#e1").length > 4) {
$("#e1").css("background-color", "yellow");
};
});
</script>
</head>
<body>
<p>NOMBRE:<input type="text" id="e1" /></p><br />
<p>EMAIL:<input type="email" /></p>
</body>
</html>