Search
 
SCRIPT & CODE EXAMPLE
 

HTML

jquery select2 set value

<select id="lang" >
   <option value="1">php</option>
   <option value="2">asp</option>
   <option value="3">java</option>
</select>

<script>
	$("#lang").select2().select2('val','1');
</script>
Comment

select2 tags set value jquery

$('#mySelect').select2({
  data: ['one','two'],
  tags: true
});
$('#mySelect').val(['one','two']).trigger('change')
Comment

get select2 selected value jquery

$('#id :selected').text();
Comment

select2 set value jquery

$('#inputID').select2('data', {id: 100, a_key: 'Lorem Ipsum'});
Comment

select2 set value jquery

$('#all_contacts').select2('data', {id: '123', text: 'res_data.primary_email'});
Comment

PREVIOUS NEXT
Code Example
Html :: add spaces html 
Html :: html link tag 
Html :: bootstrap 5 vertical align 
Html :: How to install sweetalert2 with CDN? 
Html :: Html.Raw blazor 
Html :: classs for making text bold in bootstarp 
Html :: chrome clear cache for one site 
Html :: add favicon to website html 
Html :: drop down onchange javascript 
Html :: multi line comment html 
Html :: html form only accept zip folders 
Html :: bootstrap 5 line height 
Html :: href new window html 
Html :: html viewport meta tag 
Html :: select html unselectable option 
Html :: randome code 
Html :: html file input accept excel file 
Html :: Checkbox checked border radius CSS 
Html :: html input radio 
Html :: how to add space between buttons 
Html :: html if en change to ltr 
Html :: What Is the Metaverse? 
Html :: how to embed an image in html 
Html :: square div 
Html :: Send a SMS Text From A Link - the new code 
Html :: button functions html 
Html :: how to pass two values in one html.actionlink 
Html :: html unicode info icon 
Html :: datatable pdfHtml5 pagesize 
Html :: bootstrap nav search form 
ADD CONTENT
Topic
Content
Source link
Name
5+3 =