jQuery select onchange Example

(Last Updated On: May 2, 2014)

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>
<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>

Output:
jquery select onchange

Recommended jQuery Books:

487 total views, 0 views today

Leave a Reply

Your email address will not be published. Required fields are marked *