disabled
//提交前移除disabled
$('.tbody').find('input, textarea, button,select').removeAttr("disabled");
readonly
/*readonly unselectable="on" 该属性跟disable类似,
input 元素,不可编辑,不可复制,不可选择,不能接收焦点,
设置后文字的颜色也会变成灰色,但是后台可以接收到传值。
*/
示例:
<input type="text" readonly unselectable="on" >
//加入如下的样式
<style>
select[readonly] {
background: #eee;
cursor: no-drop;
}
select[readonly] option {
display: none;
}
</style>
//使用时,加上readonl属性就行, 但由于有上面的样式在,所以下拉框是点不动
<select name="" id="" readonly>
<option value="">1</option>
<option value="">1</option>
</select>
//input框很简单直接在点击时加上return false,来阻止点击事件
<input type="radio" onclick="return false;">苹果
<input type="radio" onclick="return false;">榴莲