<!DOCTYPE html>
<html>
<head>
<script src="https://libs.baidu.com/jquery/2.1.4/jquery.min.js"></script>
<script>
$(document).ready(function(){
$(".field").change(function(){
$(this).css("background-color", "#D6D6FF");
});
});
</script>
</head>
<body>
<p>Attach a function to run when an element has been changed:</p>
Enter your name: <input class="field" type="text">
<p>Write something in the input field, and then press enter or click outside the field.</p>
Car:
<select class="field" name="cars">
<option value="volvo">Volvo
<option value="saab">Saab
<option value="fiat">Fiat
<option value="audi">Audi
</select>
<p>Select an option in the drop-down list.</p>
</body>
</html>