ar4ipers,
<!DOCTYPE html>
<html>
<head>
<title>Untitled</title>
<meta charset="utf-8">
<style type="text/css"> .red{
background-color: #FF0000;
}
</style>
</head>
<body>
<input type="text" name="name" class="js_name" value="sometext">
<script>
var input = document.querySelector(".js_name");
var valueInput = input.value;
input.oninput = function () {
input.className = "";
if (valueInput != input.value) {
input.className = "red"
}
};
</script>
</body>
</html>