在html中是select readonly后,依然可以下拉选择,不想做disabled增加隐藏域,下面提供两种解决方案
解决方案1:
onfocus="this.defaultIndex=this.selectedIndex;" onchange="this.selectedIndex=this.defaultIndex;"
解决方案2,通过css解决,无法看到其他选项
select[readonly] { background: #eee; cursor: no-drop; } select[readonly] option { display: none; }
原文地址:http://blog.csdn.net/zml6308/article/details/46345393