I have a menu select that's populated with 5 items. When the page that it's on is loaded, I'd like to start with the menu select on item 3. How do I set it with JS (not with 'set property' in the builder)?
-thanks
I have a menu select that's populated with 5 items. When the page that it's on is loaded, I'd like to start with the menu select on item 3. How do I set it with JS (not with 'set property' in the builder)?
-thanks
Hello Brain!
Can you clear, do you want the third item to be chosen? I'm not sure I understand you correctly.
Hi, yes the third (or whatever) menu choice should be the one that's automatically selected when the page loads (as if the user had selected it).
It'll actually be a local variable, instead of a hard-coded 3. What I'm doing is having the user make a selection on one page then I want that selection to carry through to another page when it loads.
Hi Brian,
Run the following:
codeAppery( "selectmenu_name" ).find( "option:eq(2)" ).attr("selected", "selected");
Appery( "selectmenu_name" ).selectmenu( "refresh" );/code
Thanks! That works perfectly!