Scroll to top

How to get Selected Option Text of HTML SELECT using jQuery?

Get Selected Option Text of HTML SELECT using jQuery


<select id=”mySelect”>
    <option value=”1″>hello</option>
    <option value=”2″>bro</option>
</select>
<input type=”button” id=”test value = test />
<script type=”text/javascript”>
    $(“#test”).live(“click”function () {
        
        var selectedText = $(“#mySelect option:selected”).html();
        alert(selectedText);
    });
</script>

Leave a Reply

Your email address will not be published.