logo
Search
showing results for - "select2 find option by text"
Emilia
17 Aug 2016
1let long_name = 'Australia';
2let $element = $('.country-js')
3let val = $element.find("option:contains('"+long_name+"')").val()
4$element.val(val).trigger('change.select2');
5
source
Luka
22 Oct 2017
1$("#select").select2("val", $("#select option:contains('Text')").val() );
2
source
similar questions
how to set value select2select2 preselect optionselect2 find option by valuejquery to set value in select2 dropdown buttonselect2 replace optionsselect options of select2 control based on values using jqueryselect2 jquery example searchjquery get selected text from multiselectjquery select2 multiple select allselect2 tags set value jqueryselect multiple dropdown by using select2 library javascript
queries leading to this page
select2 input text tagsselect2 get textselect2 textselect2 select by textselect2 get selected textselect2 get text valueget selected option text select2select2 find option by textjquery select2 get selected textget text select2select2 get text selected optionselect2 set selected textselect2 seelcted by textselect2 find option by text
privacy policyterms of useinstagram
Crafted with  ♥  for everyone

sign in to continue
your answer for
you will get a confirmation link on this - you will have to click that for successful submission of your answer. we require this to keep the website free of spam, bots and unhelpful content
please ensure to add code which is syntactically corrent and executes properly
sign in to continue
ask question on maxinterview
you will get a confirmation link on this - you will have to click that for successful submission of your question. we require this to keep the website free of spam, bots and unhelpful content
please be clear, to the point and respectful
sign in to continue