如何在 IE11 中获取颜色选择器 我在 ie11 中键入时只得到文本框
<input type="color" name="clr1" value=""/>
上面的代码在 chrome 中运行良好,但在 IE 中它只显示文本框。
最佳答案
试试这个:
<![if !IE]>
<input type="color" name="clr1" value=""/>
<![endif]>
<!--[if IE]>
<input type="text" name="clr1" value="" style="display:none"/>
<button onclick="var s = Dlg.ChooseColorDlg(clr1.value); window.event.srcElement.style.color = s; clr1.value = s">█████</button>
<object id="Dlg" classid="CLSID:3050F819-98B5-11CF-BB82-00AA00BDCE0B" width="0" height="0"></object>
<![endif]-->
关于javascript - 如何在 Internet Explorer 中获取拾色器,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/27266402/