artur2307,
<!DOCTYPE html>
<html>
<head>
<title>Untitled</title>
<meta charset="utf-8">
<style type="text/css">
input.invalid {
background-color: #FFFF00;
}
</style>
<script>
document.addEventListener("DOMContentLoaded", function() {
let input = document.getElementById('inp3');
let yes = 'absde';
input.addEventListener("input", function() {
input.classList.toggle("invalid", input.value.length > yes.length)
})
})
</script>
</head>
<body>
<input type="text" value="" id="inp3">
</body>
</html>