schilly Posted June 4, 2009 Share Posted June 4, 2009 Is this possible? What is the best way to go about doing this? Would I have to find the current selected option, remove the selected attribute then set the option I want selected? Thanks. Link to comment https://forums.phpfreaks.com/topic/160978-solved-jquery-change-pulldown-menu-selected-item-with-a-button-click/ Share on other sites More sharing options...
Ken2k7 Posted June 4, 2009 Share Posted June 4, 2009 Just select the one you want selected. HTML will DTRT by un-selecting whatever is selected to the one you/the code selected. Link to comment https://forums.phpfreaks.com/topic/160978-solved-jquery-change-pulldown-menu-selected-item-with-a-button-click/#findComment-849580 Share on other sites More sharing options...
schilly Posted June 4, 2009 Author Share Posted June 4, 2009 ok found the answer here. http://stackoverflow.com/questions/149573/check-if-option-is-selected-with-jquery-if-not-select-a-default $("#mySelect option[value=3]").attr('selected', 'selected'); thx. Link to comment https://forums.phpfreaks.com/topic/160978-solved-jquery-change-pulldown-menu-selected-item-with-a-button-click/#findComment-849590 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.