简体   繁体   English

如何制作可点击的下拉菜单

[英]How to make clickable dropdown

In dropdown content by clicking the content the input box would open .I have prepared the dropdown在下拉内容中,通过单击内容将打开输入框。我已准备好下拉列表

This is my Code:这是我的代码:

 <div class="dropdown"> <button onclick="myFunction()" class="dropbtn">Dropdown</button> <div id="myDropdown" class="dropdown-content"> <a href="#education">Education <div class="form-popup" id="myForm"> <form action="/action_page.php" class="form-container"> <label for="12th percentage"><b>12 percentage</b></label> <input type="text" placeholder="Enter percentage" name="percentage" required> <label for="highest degree"> <b>Highest degree</b> </label> <input type="text" placeholder="Enter degree" name="degree" required> </form> </div> </a> <a href="#address">Address </a> <a href="#contact">Contact </a> </div>

You could start with this and work from there.你可以从这个开始,然后从那里开始工作。 Your question is pretty vague so it would help to specify it and add your CSS/JS too.你的问题很模糊,所以它会有助于指定它并添加你的 CSS/JS。

#myDropdown {
  display: none;
}

function myFunction() {
    document.getElementById('myDropdown').style.display = "block";
}

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM