How to access a drop down list using jquery?
Hi,
I have added a search box and a drop down list for it and trying to link the drop down option in the search box.My code is:
var quickSearchConfig = {
delay: 500, // time to wait before executing the query (in ms)
minCharacters: 3, // minimum nr of characters to enter before search
scope: "All Scopes", // search scope to use
numberOfResults: 15, // number of results to show
resultsAnimation: 200, // animation time (in ms) of the search results
resultAnimation: 0 // animation time (in ms) of individual result (when selected)
in the scope i want to get a variable to access the drop down options dynamically.Is it possible?
I added the drop down as
><select id="ddlScopes"> <option>All Sites</option> <option>People</option> <option>Content</option> <option>Groups</option></select>
and trying to access it as:
var s=$("#ddlScopes option:selected").text();
and when I am putting the variable "s" in place of scope in quickSearchConfig it is not working.
What can be done?Please suggest...
Thanks
Sucharita30