ok
Direktori : /home2/selectio/www/subamangala/admin/ |
Current File : //home2/selectio/www/subamangala/admin/dropdown.php |
<!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8"> <meta name="viewport" content="width=device-width, initial-scale=1.0"> <!-- Select2 CSS CDN --> <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/select2/4.0.13/css/select2.min.css"> <style> .select2-container { width: 100%; } </style> <!-- jQuery CDN --> <script src="https://code.jquery.com/jquery-3.6.0.min.js"></script> <!-- Select2 JS CDN --> <script src="https://cdnjs.cloudflare.com/ajax/libs/select2/4.0.13/js/select2.min.js"></script> <title>Auto Height and Width Select2</title> </head> <body> <select class="js-example-basic-multiple" multiple="multiple"> <option value="option1">Option 1</option> <option value="option2">Option 2</option> <option value="option3">Option 3</option> </select> <select class="js-example-basic-multiple" multiple="multiple"> <option value="optionA">Option A</option> <option value="optionB">Option B</option> <option value="optionC">Option C</option> </select> <script> // Initialize Select2 $(document).ready(function() { $('.js-example-basic-multiple').select2({ width: 'resolve', // Adjusts the width of the dropdown to match the width of the select box theme: 'classic', // You can change the theme based on your preference dropdownAutoWidth: true, // Allows the dropdown to automatically adjust its width dropdownAutoHeight: true // Allows the dropdown to automatically adjust its height }); }); </script> </body> </html>