Example of .change() in jQuery

March 31, 2013
.change() in jQuery is applied on any DOM element like input type text and select. When the value is changed, this function is called. If we call on select input type, it can be called as
$("select").change()
 
Find the sample example.

<!DOCTYPE html>
<html>
<head>
<script src="http://code.jquery.com/jquery-1.9.1.js"></script>
</head>
<body>
<select name="concretepage">
<option>Change Value</option>
<option>A</option>
<option>B</option>
</select>

<script>
$("select").change(function () {
  alert('Your selection is changed.')
});
</script>

</body>
</html>
 









©2023 concretepage.com | Privacy Policy | Contact Us