Search
 
SCRIPT & CODE EXAMPLE
 

HTML

select2

<!-- Style -->
<link href="https://cdn.jsdelivr.net/npm/select2@4.1.0-beta.1/dist/css/select2.min.css" rel="stylesheet" />
<!-- Script -->
<script src="https://cdn.jsdelivr.net/npm/select2@4.1.0-beta.1/dist/js/select2.min.js"></script>
<script>
// In your Javascript (external.js resource or <script> tag)
$(document).ready(function() {
    $('.js-example-basic-single').select2();
});
</script>
Comment

select2 html example

<html>
        <script src="https://code.jquery.com/jquery-2.2.4.js"></script>
        <link href="https://rawgit.com/select2/select2/master/dist/css/select2.min.css" rel="stylesheet" />
        <script src="https://rawgit.com/select2/select2/master/dist/js/select2.js"></script>

        <select id="example" style="width: 300px">
            <option></option>
            <option value="JAN">January</option>
            <option value="FEB">February</option>
            <option value="MAR">March</option>
            <option value="APR">April</option>
            <option value="MAY">May</option>
            <option value="JUN">June</option>
            <option value="JUL">July</option>
            <option value="AUG">August</option>
            <option value="SEP">September</option>
            <option value="OCT">October</option>
            <option value="NOV">November</option>
            <option value="DEC">December</option>
        </select>

        <script>
            window.onpageshow = function() {
                $('#example').select2({
                    allowClear: true,
                    placeholder: 'Select a month'
                });
            };
        </script>
</html>

Comment

select2 .select2-results .select2-highlighted

$(document).ready(function() {
    $("#menuOption1").select2({dropdownParent: "#menuOption1-container"});
    $("#menuOption2").select2({dropdownParent: "#menuOption2-container"});
});
Comment

select2 .select2-results .select2-highlighted

<span id="menuOption1-container">
    <select id="menuOption1"> 
        <option value="1"> One </option>
        <option value="2"> Two </option>
        <option value="3"> Three </option>
        <option value="4"> Four </option>
        <option value="5"> Five </option>
    </select>
</span>

<span id="menuOption2-container">
    <select id="menuOption2"> 
        <option value="a"> Vowel a </option>
        <option value="e"> Vowel e </option>
        <option value="i"> Vowel i </option>
        <option value="o"> Vowel o </option>
        <option value="o"> Vowel u </option>
    </select>
</span>
Comment

select2

$(".js-example-basic-multiple-limit").select2({
  maximumSelectionLength: 3
});
Comment

select2 .select2-results .select2-highlighted

#menuOption1-container  .select2-results__option--highlighted {
    background-color: #50831F !important;
}

#menuOption2-container  .select2-results__option--highlighted {
   background-color: #28915F !important;
}
Comment

select2

// In your Javascript (external .js resource or <script> tag)
$(document).ready(function() {
    $('.js-example-basic-single').select2();
});
Comment

PREVIOUS NEXT
Code Example
Html :: how to write superscript in html 
Html :: javascript delay button 
Html :: Bootstrap 5.2 Starter Template | bootstrap starter template 
Html :: toggle font awesome icon 
Html :: non dismisal modal bootstrap 
Html :: ASP.NET MVC Two file upload, different destinations 
Html :: svg xlink 
Html :: html5 video player autoplay 
Html :: navigation bar on more than one page 
Html :: placeholder image html 
Html :: HTML Select Dropdown Menu 
Html :: Responsive container centered 
Html :: input float 
Html :: laravel blade remove html tags 
Html :: internet and intranet 
Html :: times hmrl 
Html :: get directions google maps html 
Html :: how to disable shadow in bootstrap button 
Html :: how to add telephone number in html 
Html :: change body font 
Html :: how to align image in right in html 
Html :: full screen button in video tag html5 
Html :: how to set logo on site tab 
Html :: select placeholder 
Html :: bootstrap vertical hr 
Html :: how to set background image for web page in html local image 
Html :: Drupal twig get value of entity reference field 
Html :: html input box integer only 
Html :: git pull one file 
Html :: image with url html 
ADD CONTENT
Topic
Content
Source link
Name
7+2 =