onchange Event Jquery

The onchange event occurs when the value of an element has been changed. For radiobuttons and checkboxes, the onchange event occurs when the checked state has been changed. You may also like Jquery change event and Onsubmit event using ajax and return true but Form not submit using Jquery.

HTML Code

<select  onchange="myFunction($(this).val())">
    <option value="1">1</option>
    <option value="2">2</option>
    <option value="3">3</option>
    <option value="4">4</option>
</select>

Jquery Code

<script type="text/javascript">
    function myFunction(value)
    {
        alert(value);
    }
</script>

Leave a Reply

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