Search
 
SCRIPT & CODE EXAMPLE
 

HTML

html js make dropdown list checkbox

<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>
Comment

PREVIOUS NEXT
Code Example
Html :: a go to section 
Html :: form validation using html/css/js 
Html :: white text html 
Html :: favicon.ico 404 
Html :: embed link in markdown 
Html :: how to add an image to my web page from my computer 
Html :: pass data from blade/laravel to vue 
Html :: javascript window.print 
Html :: bootstrap 5.0 css cdn 
Html :: Resize the image in jupyter notebook 
Html :: aos 
Html :: how to refer to external style sheet 
Html :: how to set background image for web page in html local image 
Html :: clear input file html react 
Html :: summernote 
Html :: yellow html 
Html :: how to use lottie in html 
Html :: row span 
Html :: tailwind flex shrink 
Html :: js download File object 
Html :: html table link 
Html :: html if screen is smaller thatn 
Html :: how to add an ident in html 
Html :: video html player 
Html :: target vs currenttarget 
Html :: thymeleaf form delete method 
Html :: how to increaase font size on html 
Html :: html form templates 
Html :: favicon x shortcut icon 
Html :: html percentage 
ADD CONTENT
Topic
Content
Source link
Name
9+2 =