Watch this example on YouTube
<select id="ddlID">
<option value="0">blue</option>
<option value="0">yellow</option>
<option value="0">green</option>
</select>
@section Scripts{
<script type="text/javascript">
$("#ddlID option").filter(function () {
return $(this).text().trim() == "yellow";
}).prop('selected', true);
</script>
}
No comments:
Post a Comment