“HTML JS Erstellen Sie das Kontrollkästchen Dropdown -Liste” Code-Antworten

HTML JS Erstellen Sie das Kontrollkästchen Dropdown -Liste

<body>
  
    <div id="list1" class="dropdown-check-list" tabindex="100">
        <span class="anchor">Select Fruits</span>
        <ul class="items">
            <li><input type="checkbox" />Apple </li>
            <li><input type="checkbox" />Berry </li>
            <li><input type="checkbox" />Mango </li>
            <li><input type="checkbox" />Banana </li>
        </ul>
    </div>

    <script type="text/javascript">
      
        var checkList = document.getElementById('list1');
        checkList.getElementsByClassName('anchor')[0].onclick = function (evt) {
            if (checkList.classList.contains('visible'))
                checkList.classList.remove('visible');
            else
                checkList.classList.add('visible');
        }

        checkList.onblur = function(evt) {
            checkList.classList.remove('visible');
        }
    </script>
</body>
Powerful Penguin

HTML JS Erstellen Sie das Kontrollkästchen Dropdown -Liste

445454
Yucky Yacare

Ähnliche Antworten wie “HTML JS Erstellen Sie das Kontrollkästchen Dropdown -Liste”

Fragen ähnlich wie “HTML JS Erstellen Sie das Kontrollkästchen Dropdown -Liste”

Weitere verwandte Antworten zu “HTML JS Erstellen Sie das Kontrollkästchen Dropdown -Liste” auf HTML

Durchsuchen Sie beliebte Code-Antworten nach Sprache

Durchsuchen Sie andere Codesprachen