Thursday, November 5, 2015

how to select dropdown based on value using jQuery?

In this post, Set selected dropdown value in page Load

HTML Code:

<select id="Status" title="Status">
<option selected="selected" value="0">New</option>
<option value="3">ANSWERED</option>
<option value="7">ARCHIVED</option>
<option  value="2">ASSIGNED</option>
<option value="9">DEFERMENT REQUESTED</option>
</select>
Jquery:

<script type="text/javascript">

 

    $(document).ready(function() {

$("select[title^='Status'] option:selected").text("New")
});
</script>

No comments:

Post a Comment