Created
October 11, 2013 07:50
-
-
Save XORwell/6931103 to your computer and use it in GitHub Desktop.
filter select input and set the selected value
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| function set_select_selected(value){ | |
| $("#my_field > option").filter(function() { | |
| return $(this).text() == value //the condition | |
| }).prop('selected', true); | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment