显示与隐藏问题,急? if(A) echo"tableA";if(B) echo"tableB"; 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 <script language=javascript> function show_table() { for(i = 0; i < document.all.show_tb.length; i++){ if( document.all.show_tb.options[i].selected ) { if( document.all.show_tb.options[i].value == 'A'){ document.all('tb_A').style.display = ''; document.all('tb_B').style.display = 'none'; } else if( document.all.show_tb.options[i].value == 'B'){ document.all('tb_B').style.display = ''; document.all('tb_A').style.display = 'none'; } else { document.all('tb_B').style.display = 'none'; document.all('tb_A').style.display = 'none'; } break; } } }</script><select name="show_tb" onchange="show_table()"> <option value=""></option> <option value="A">A</option> <option value="B">B</option></select><div id="tb_A" style="display:none"> <table> <tr> <td>test a</td> </tr> </table></div><div id="tb_B" style="display:none"> <table> <tr> <td>test b</td> </tr> </table></div> 问题以解决,多谢大家的支持,多谢piner(php&自由通)的程序代码! 帮我看看这句话哪里错了?加@就好了! 北京PHPer求职~2年半开发经验 php 链接数据库 怎么修改select到的数据最大值 [北京创业团队] LAMP工程师请进 这句代码中的变量为什么没有值了? 提示:无法载入 mysql 扩展,请检查 PHP 配置.请问这是什么原因?如何解决.谢谢!! 还是smarty的问题啦~~ 连接数据库服务器 新手入门之一问(在线等。。。。) 安装php出现问题,急死人了 通过web方式实现定时操作遇到的问题:PHP脚本中如何获取php命令的系统路径? 远程访问Mysql出现一下提示应该怎么做
function show_table()
{
for(i = 0; i < document.all.show_tb.length; i++){
if( document.all.show_tb.options[i].selected )
{
if( document.all.show_tb.options[i].value == 'A'){
document.all('tb_A').style.display = '';
document.all('tb_B').style.display = 'none';
}
else if( document.all.show_tb.options[i].value == 'B'){
document.all('tb_B').style.display = '';
document.all('tb_A').style.display = 'none';
}
else
{
document.all('tb_B').style.display = 'none';
document.all('tb_A').style.display = 'none';
}
break;
}
}
}
</script>
<select name="show_tb" onchange="show_table()">
<option value=""></option>
<option value="A">A</option>
<option value="B">B</option>
</select>
<div id="tb_A" style="display:none">
<table>
<tr>
<td>test a</td>
</tr>
</table>
</div>
<div id="tb_B" style="display:none">
<table>
<tr>
<td>test b</td>
</tr>
</table>
</div>