我正在使用以下代码来显示或隐藏表格,具体取决于是否选中了复选框。
<body onload="document.f.firstfield.focus(),showOnLoad();">
我的 Javascript 是:
function showOnLoad(){
if((document.getElementById('chk').checked)){
document.getElementById('div1').style.display = "block";}else{
document.getElementById('div1').style.display = "none";}
}
到此为止,它的工作正常。但是,现在我想使用另一个功能showSomething()
与上面相同的功能,但用于不同的复选框和不同的表格。
当我将代码行更改为此:
<body onload="document.f.firstfield.focus(),showSomething(),showOnLoad();">
这两个功能都不起作用。我怎样才能让它们一起工作?任何帮助表示赞赏!