![](/img/trans.png)
[英]How can I make an HTML box slide on hover and reveal the text underneath it using JS or CSS
[英]How I can make custom select box with search bar using html css js
我正在嘗試使用 html css 和 js 制作帶有搜索欄的自定義 select 框。 完成后它不起作用(滾動條不起作用,搜索欄也不起作用)
選中復選框時顯示一些文本:
HTML:
Checkbox: <input type="checkbox" id="myCheck" onclick="myFunction()">
<p id="text" style="display:none">Checkbox is CHECKED!</p>
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.