点击按钮,加载一个文本域,怎么实现?
来源:百度知道 编辑:UC知道 时间:2024/05/11 03:34:20
不要用flash,就用脚本。
麻烦再说的详细点
<body onload="javascript:....">的时候先隐藏楼主应该会吧,
然后写一个checkbox的控件
<input type="checkbox" id="isAddContactor" onclick="isDisplay('isAddContactor','addContactor', true);">
然后结合下面这个js
function isDisplay(isCheck, display, flag){
var is = $(isCheck).checked ;
//$(isCheck)相当于getElementbyId('isCheck');
if(flag){
//flag=true表示,文本域一开始是隐藏的现在要去打开,反之flag=false表示一开始是出现的要去关闭,我这样写可以有两种用途,隐藏的文本域在checkbox打勾则打开,打开的文本域在checkbox打勾则关闭
if(is){
document.all[display].style.display="inline";
}else{
document.all[display].style.display="none";
}
}else{
if(is){
document.all[display].style.display="none";
}else{
document.all[display].style.display="inline";
}
}
}
就可以了
————————————————————————
如果按这题的答法,你的文本域的id名应该是addContactor
&