单击下拉菜单本身将您带到新页面时,我需要下拉按钮为超链接 请在下面查看此代码: https://www.w3schools.com/howto/tryit.asp?filename=tryhow_js_responsive_navbar_dropdown
答案 0 :(得分:1)
您可以通过使用js来实现。
//get the select element
var select = document.querySelector('#myselect');
//registering event listener
select.addEventListener('change', select_change);
function select_change(event) {
var url = event.target.value;
window.location.href = url;
}
<select id="myselect">
<option value="https://google.com">Test</option>
<option value="https://yahoo.com">Test 2</option>
</select>