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");
input.oninput = function () {
with(this) className = defaultValue == value ? "" : "red";
};
</script>
</body>
</html>