[英]How I can make custom select box with search bar using html css js
i am trying to make a custom select box with search bar using html css and js.我正在尝试使用 html css 和 js 制作带有搜索栏的自定义 select 框。 once done it didn't work (scroll bar didn't work, and search bar too)
完成后它不起作用(滚动条不起作用,搜索栏也不起作用)
To display some text when the checkbox is checked:选中复选框时显示一些文本:
HTML: HTML:
Checkbox: <input type="checkbox" id="myCheck" onclick="myFunction()">
<p id="text" style="display:none">Checkbox is CHECKED!</p>
JavaScript: JavaScript:
function myFunction() {
// Get the checkbox
var checkBox = document.getElementById("myCheck");
// Get the output text
var text = document.getElementById("text");
// If the checkbox is checked, display the output text
if (checkBox.checked == true){
text.style.display = "block";
} else {
text.style.display = "none";
}}
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.