How to pull values from dropdown using jQuery, like top 10, top20, top100, these values are defined in drop down, how to pull these values in a variable and update variable value dynamically based on drop down selection.
Since "a dropdown" isn't really a semantic container, it's hard to say how the jQuery should look, but if it is, for instance, a list, just do something like: var listItem = $("#list_name li").text(); Code (markup): or something similar Or maybe post some code, so we know what we're dealing with...
Let me help you construct a bare HTML dropdown to start with; <select id="countries"> <option value="US">USA</option> <option value="UK">Britain</option> <option value="FR">France</option> </select> HTML: And from that structure, you can use jQuery to get anything you want from the selected drop down; //For the text var txt = $('#countries').find('option:selected').text(); //For other attributes inside <option> var v = $('#countries').find('option:selected').attr('value'); Code (markup):