控制input输入的三种方法(二jquery实现1)
<!doctype html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Document</title>
<script src="http://code.jquery.com/jquery-1.8.3.js"></script>
<script type="text/javascript">
function hide() {
var mode = $("#mode");
var hykhLkInput = $("#hykh_lk");
if(mode.val() == 1){
hykhLkInput.css({"background-color":"#ffffff"});
hykhLkInput.removeAttr("readonly");
}else{
hykhLkInput.css({"background-color":"#d2d2d2"});
hykhLkInput.attr("readonly",true);
}
}
</script>
</head>
<body onload="hide();">
<select name="mode" id="mode" class="dept_select" style="width: 100px;" onchange="hide();">
<option value="1" #if($resultMap.mode==1)selected#end>离场车辆</option>
<option value="2" #if($resultMap.mode==2)selected#end>进场车辆</option>
<option value="3" #if($resultMap.mode==3)selected#end>滞留车辆</option>
</select>
<input type="text" name="hykh_lk" id="hykh_lk" value="124" style="width: 100px;"/>
</body>
</html>