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>
Also in HTML:
- html js make dropdown list checkbox
- how to use a article html
- html doctype declaration
- angular read element from html by atribute name
- how to align table in html
- inline javascript html
- tab completion vscode
- js onclick redirect
- how to make a clock in html/javascript
- copyright symbol in html
- responsive youtube embed html
- add a caption of picture html
- html underline
- vertical rule html
- markdown to html
- ui and li in html
- how to strike out text in html
- python in html
- make text bold js
- How to connect your app project with home.html
- html input
- scrapy get raw html content of selector innerhtml
- There is no formatter for 'django-html' files installed.
- how to set background image for web page in html local image