模拟可以输入select标签问题
- HTML code
<div style="width:100px;overflow:hidden;position:relative;background:red;"><select id="aa" style="width:100px;position:absolute;left:0;top:1px;clip:rect(1px auto auto 81px);" onchange="this.nextSibling.value=this[this.selectedIndex].innerText" ><option value="aa">aa1</option><option value="bb">bb1</option><option value="cc">cc1</option></select><input name="dd" type="text" id="dd" style="width:100px; " /></div>
通过以上模拟出可以输入和选择的select标签。
但原来select聚焦以后鼠标中键滑动可以改变选项
文本框覆盖上面,一般只聚焦到文本,如果通过文本框鼠标中键滑动来改变选择项
[解决办法]
一般现成的UI框架是用DIV来模拟的