How to select the first element of a dropdown using jQuery?

Written by rsolberg on. Posted in All, Software Development

Let’s suppose that you are trying to identify what the first element or value us within a dropdown menu or specifically a select list. Suppose that your select list looks like this… If you wanted to figure out what the very first element of the drop down was, you could use this line of jQuery to get it. Suppose that you wanted to update all the selects or dropdown menus on your page to the first item in the list… You could do that by executing this line of jQuery.    
Be Sociable, Share!

Tags: , , , , ,

Trackback from your site.

Leave a comment

© Copyright RSolberg, 2003 - 2014. All Rights Reserved