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;">榴蓮