Answers for "select2 value change using jquery"

2

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>
Posted by: Guest on May-10-2021
0

select2 on change

<script>
  	$('#exampleSelect2').select2().on('change', function(){
		// ...
	});
</script>
Posted by: Guest on October-23-2021

Code answers related to "select2 value change using jquery"

Browse Popular Code Answers by Language