1.Js怎么写能控制单元格不可修改
原生 javascript 示例 ( 表格+input ):
A | B | C | D | |
1 | ||||
2 | ||||
3 |
2.怎么将input内的行内样式改成全局样式 或者全部写在js内有同样的效果
<!DOCTYPE html>
<html>
<head>
<title></title>
<script type="text/javascript" >
function action1(){
document.getElementById("dv").style.width="200px";
}
function action2(){
document.getElementById("dv").style.width="100px";
}
</script>
</head>
<style>
.a{
width:100px;
height:100px;
background-color:red;
}
</style>
<body>
<div class="a" id="dv">
</div>
<input type="button" onclick="action1();" value="点击增长div宽度" />
<input type="button" onclick="action2();" value="点击还原div宽度" />
</body>
</html>