Home > ASP.Net, Jquery > Set Selected Item of DropdownList using JQuery

Set Selected Item of DropdownList using JQuery


Hi all try this example to Set Selected Item of DropdownList using JQuery

<select id="MySelect" class="SelectClass">               
    <option>Item 1</option> 
    <option>Item 2</option>              
    <option>Item 3</option> 
</select> 
 
<script>
    function Test() 
     { 
         $("#MySelect option:contains('Item 3')").attr('selected', true); 
     } 
</script>
 

Hope this helps

Good Luck

Advertisements
Categories: ASP.Net, Jquery
  1. No comments yet.
  1. No trackbacks yet.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: