jQuery select onchange Example
jQuery select onchange Example:
Select dropdown onchange can be done using both javascript and jQuery.
We have done here using jQuery. Please find the program below,
Select Onchange jQuery Sample:
[html]
<html>
<head>
<script src="http://code.jquery.com/jquery-1.9.1.js"></script>
<script type="text/javascript">
$(document).ready(function(){
$( ‘.left_select’).change(function() {
alert($(‘.left_select’).val());
});
});
</script>
</head>
<body>
<div class="dropdown">
<select class="left_select">
<option value="java" selected>Java</option>
<option value="php">PHP</option>
<option value="javascript">JavaScript</option>
</select>
</div>
</body>
</html>
[/html]
Recommended jQuery Books: