<!DOCTYPE html>
<html>
<head>
<title></title>
<meta charset="utf-8">
</head>
<body>
<table id="thisTable">
<tr>
<td>id</td>
<td>name</td>
<td>age</td>
</tr>
<tr>
<td>001</td>
<td><input value="Laowang" /></td>
<td>10</td>
</tr>
<tr>
<td>002</td>
<td><input value="Yan"/></td>
<td>9</td>
</tr>
<tr>
<td>003</td>
<td><input value="Guanyu"/></td>
<td>9</td>
</tr>
</table>
</body>
<script type="text/javascript">
window.onload=function(){
var thisTable = document.getElementById("thisTable");
var inputs = document.getElementsByTagName("input");
for(var i=0;i<inputs.length;i++){
var input = inputs[i];
input.style="border:0px";
input.readOnly="true";
input.onClick="mod()";
console.log(input);
}
}
function mod(){
console.log(111);
}
</script>
</html>
dom.setAttribute("onclick","fun1(this)");