Search
 
SCRIPT & CODE EXAMPLE
 

JAVASCRIPT

Select options of Select2 control based on values using Jquery

$('#mySelect2').val('1'); // Select the option with a value of '1'
$('#mySelect2').trigger('change'); // Notify any JS components that the value changed
Comment

get select2 selected value jquery

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

Select options of Select2 control based on values using Jquery

$('#mySelect2').val(['1', '2']);
$('#mySelect2').trigger('change'); // Notify any JS components that the value changed
Comment

jquery select2 multiple select all

$("#checkbox").click(function(){
    if($("#checkbox").is(':checked') ){
        $("select > option").prop("selected","selected");
    }else{
        $("select > option").removeAttr("selected");
     }
});
Comment

PREVIOUS NEXT
Code Example
Javascript :: how to add onclick to child element created javascript 
Javascript :: getrecord lwc 
Javascript :: service worker registration 
Javascript :: monaco editor get content 
Javascript :: js append zeros 
Javascript :: react usememo 
Javascript :: round 2 decimales js 
Javascript :: how to give icon in input type file react 
Javascript :: node js if no arguments 
Javascript :: join in javascript 
Javascript :: clearinterval javascript 
Javascript :: alert javascript 
Javascript :: set property js 
Javascript :: db.json code 
Javascript :: connect existing database with sequelize 
Javascript :: proper to mixed fraction in javascript 
Javascript :: document.queryselector 
Javascript :: open ai gym 
Javascript :: javascript the event loop 
Javascript :: deno vs nodejs 
Javascript :: nds npm 
Javascript :: Upload different files in different folders using Multer in NodeJs 
Javascript :: axios interceptors 
Javascript :: else return 
Javascript :: negate regular expression 
Javascript :: components in react 
Javascript :: use jquery in project using NPM 
Javascript :: javascript player movement 
Javascript :: Automatic Slideshow in react js 
Javascript :: randomize an array 
ADD CONTENT
Topic
Content
Source link
Name
2+3 =