Search
 
SCRIPT & CODE EXAMPLE
 

JAVASCRIPT

select2 get selected value

//get all selected select object
$('#select2Id').find(':selected');

//get all selected value 
$("#select2Id").select2("val");
Comment

get select2 selected value jquery

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

select2 find option by value

$('#Select2ID option[value="actualVal"]).text()
Comment

select2 multi select get selected value

alert("Selected value is: "+$(".leaderMultiSelctdropdown").select2("val"));

alternatively, if you used a regular selectbox as base, you should be able to
use the normal jquery call, too:

alert("Selected value is: "+$(".leaderMultiSelctdropdown").val());
Comment

PREVIOUS NEXT
Code Example
Javascript :: find last prisma 
Javascript :: jquery append text to div 
Javascript :: javascript array of cumulative sum 
Javascript :: how to detect safari browser in javascript 
Javascript :: remove all dots from string javascript 
Javascript :: wait until foreach is done javascript 
Javascript :: conditionally add a property to an object 
Javascript :: align left text in reactstrap 
Javascript :: how to convert number to array in javascript using Array.from 
Javascript :: get selected text of html dropdown in javascript 
Javascript :: nginx rewrite proxy_pass 
Javascript :: replace an element with another jquery 
Javascript :: javascript regular expression for alphanumeric 
Javascript :: console.log formdata 
Javascript :: open link in new window chrome mac shortcut 
Javascript :: jsonschema string enum 
Javascript :: if string javascript 
Javascript :: get last day of month javascript 
Javascript :: javascript format number as currency 
Javascript :: sort js array by date 
Javascript :: javascript moeda reais 
Javascript :: image next src url 
Javascript :: readonly javascript 
Javascript :: jquery set input checked 
Javascript :: detect button click jquery 
Javascript :: jquery uncheck checkbox 
Javascript :: convert to small case in javascript 
Javascript :: javascript check if value is not empty string 
Javascript :: moment is not defined 
Javascript :: parse integer javascript 
ADD CONTENT
Topic
Content
Source link
Name
4+1 =