日期:2014-05-17 浏览次数:20869 次
<script type="text/javascript">
$(document).ready(function() {
$("#nr").keyup(function() {
var a = $("#nr").val();
if(a == 1) {
$("#h1").css("display","block");
}
if(a == 2) {
$("#h1").css("display","none");
}
});
})
</script>
</head>
<body>
<table border="1px">
<tr id="h1" style="display:none">
<td>jajajaja</td>
</tr>
<tr>
<td><input type="text" id="nr"></td>
</tr>
</table>
</body>
<!DOCTYPE html>
<html>
<head>
<script>
function displayTr(e){
if(e.value=="1"){
document.getElementById("h1").style.display="";
}
if(e.value=="2"){
document.getElementById("h1").style.display="none";
}
}
</script>
</head>
<body>
<table>
<tr id="h1" style="display:''">
<td>xcsdsd</td>
</tr>
<tr>
<td><input type="text" id="nr" value="" onchange="displayTr(this)"></td>
</tr>
</table>
</body>
</html>
<!DOCTYPE html>
<html>
<head>
<script>
window.onload=function(){
if(document.getElementById("nr").value=="1"){
document.getElementById("h1").style.display="";
}
if(document.getElementById("nr").value=="2"){
document.getElementById("h1").style.display="none";
}
}
function displayTr(e){
if(e.value=="1"){
&