jueves, 26 de diciembre de 2019

How To Use Select2

Today I am going to share how to use Select2 Api. Select2 gives you a customizable select box with support for searching, tagging, remote data sets, infinite scrolling, and many other highly used options. I am going to use cdn file but you can also download it and use it on your local server.


<html>
    <head>
        <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/select2/4.0.3/css/select2.min.css" />
    </head>
    <body>
        <div style="width: 100%; height: 100%; margin: auto; text-align: center;padding:25px;">
            <select class="form-control select2" multiple="multiple">
                <option value="Apple">Apple</option>
                <option value="Banana">Banana</option>
                <option value="Berry">Berry</option>
                <option value="Guava">Guava</option>
                <option value="Orange">Orange</option>
                <option value="Pine Apple">Pine Apple</option>
            </select>
        </div>
        <script src="https://code.jquery.com/jquery-3.1.1.min.js"></script>
        <script>
            $('.select2').select2();
        </script>
    </body>
</html>

No hay comentarios:

Publicar un comentario

Cambiar tamaño de fuente al reducir la ventana (HTML / CSS)

Cambiar el tamaño del texto a medida que se reduce el tamaño de la ventana (HTML5 / CSS3)   . container { border : solid 1px blue ; ...