For this dropdownlist in HTML:
<select id="countries">
<option value="1">Country</option>
</select>
I would like to open the list (the same as left-clicking on it). Is this possible using JavaScript (or more specifically jQuery)?
For this dropdownlist in HTML:
<select id="countries">
<option value="1">Country</option>
</select>
I would like to open the list (the same as left-clicking on it). Is this possible using JavaScript (or more specifically jQuery)?
You can easily simulate a click on an element, but a click on a <select>
won’t open up the dropdown.
使用多个 Select 可能会有问题.也许您应该考虑容器元素内的单选按钮,您可以根据需要扩展和收缩.