<script>
function Refresh()
{
if (document.getElementById("r1").checked)
{
document.getElementById("c").style.display = "none";
document.getElementById("p").style.display = "";
}
else
{
document.getElementById("p").style.display = "none";
document.getElementById("c").style.display = "";
}
}
</script>
<html>
<INPUT type=radio id=r1 name="radio" CHECKED onclick="Refresh()">company
<INPUT type=radio id=r2 name="radio" onclick="Refresh()">personal
<table id=c><tr>
<td><INPUT type=text value="company login name"></td>
<td><INPUT type=text value="company password"></td>
</tr></table>
<table id=p><tr>
<td><INPUT type=text value="personal login name"></td>
<td><INPUT type=text value="personal password"></td>
</tr></table>
</html>
function Refresh()
{
if (document.getElementById("r1").checked)
{
document.getElementById("c").style.display = "none";
document.getElementById("p").style.display = "";
}
else
{
document.getElementById("p").style.display = "none";
document.getElementById("c").style.display = "";
}
}
</script>
<html>
<INPUT type=radio id=r1 name="radio" CHECKED onclick="Refresh()">company
<INPUT type=radio id=r2 name="radio" onclick="Refresh()">personal
<table id=c><tr>
<td><INPUT type=text value="company login name"></td>
<td><INPUT type=text value="company password"></td>
</tr></table>
<table id=p><tr>
<td><INPUT type=text value="personal login name"></td>
<td><INPUT type=text value="personal password"></td>
</tr></table>
</html>
解决方案 »
- 有没有谁用过jqGrid导出excel
- CSDN论坛左边链接点击效果如何实现?(ps:当前点击的链接背景是蓝色,其他的链接效果不变)
- 关于JS所谓闭包问题
- 关于Prototype.js的Ajax提交含有“&”字符的问题
- 各位!我想在页面上加上暂停和继续两个按钮控制这个程序读取并滚动的状态栏信息,可以么?
- 如何关掉一个frame,我已经弄了一天了,没办法,高手救命!
- 如何解决open一个窗口导致session丢失?
- 对某个页面刷新与链接到这个文件有什么区别
- [IE]JQuery-input:file.select()后再clone的bug,怎么解决?
- swiper 动态加载后台数据到slide中,分页符只有一个pagination怎么解决?
- 请问能否模拟出ctrl+F执行的查找操作?
- ──━─━─━── Opera中如何触发事件? 在线等待 ──━─━─━──
function Refresh()
{
if (document.getElementById("r1").checked)
{
document.getElementById("p").style.display = "none";
document.getElementById("c").style.display = "";
}
else
{
document.getElementById("c").style.display = "none";
document.getElementById("p").style.display = "";
}
}
</script>
<html>
<INPUT type=radio id=r1 name="radio" CHECKED onclick="Refresh()">company
<INPUT type=radio id=r2 name="radio" onclick="Refresh()">personal
<table id=c><tr>
<td><INPUT type=text value="company login name"></td>
<td><INPUT type=text value="company password"></td>
</tr></table>
<table id=p style='display:"none"'><tr>
<td><INPUT type=text value="personal login name"></td>
<td><INPUT type=text value="personal password"></td>
</tr></table>
</html>
用document.getElementById("DIV的ID名").style.display="none";显示
用document.getElementById("DIV的ID名").style.display="";隐藏
if (document.getElementById("r1").checked)
{
document.getElementById("p").style.display = "none";
document.getElementById("c").style.display = "";
}
没判断到document.getElementById("r1").checked,而且checked也点不出来,每次都是直接进行下面的那个一句