Home >Web Front-end >HTML Tutorial >Only in Firefox, when the A element contains Select, clicking Select cannot select option_html/css_WEB-ITnose
This is a bug encountered when using a date component of JD.com. The code to reproduce the bug is simplified as follows
<!DOCTYPE HTML><html><head> <title> 仅Firefox中A元素包含Select时点击Select不能选择option </title></head><body> <a href="javascript:void 0"><select> <option>1</option> <option>2</option> <option>3</option> <option>4</option> </select></a></body></html>
Code It's very simple. Element A contains a Select. Open the page in Firefox, click select, and the drop-down option will appear for the first time. If you click again after the second time, the option will not appear. Very strange.
Finally, in order to ensure that the option pops up normally every time you click select, you can remove element A, or replace element A with SPAN.
Tested Firefox version: 24