checkbox选中与不选中后的显示问题
我要实现这样的功能:
当我选中checkbox复选框的时候(即打个钩),在这个复选框后面显示一个button按钮,当我把复选框中的“钩”取消的时候,复选框后面的那得按钮就不显示
如此反复
请给些代码
我希望这样实现:
<input type= "checkbox " name= "chb_01 " value= "checkbox " onclick= "javascript:choose() ">
<span id= "b1 "> </span>
<script language= "JavaScript ">
function choose(){
if(判断条件)
{
document.getElementById( "add1 ").innerHTML= " <input type=\ "submit\ " name=\ "bb1\ "> ";
}
else
{
不显示按钮;
}
}
</script>
------解决方案-------------------- <input type= "checkbox " name= "chb_01 " value= "checkbox " onclick= "javascript:choose() ">
<span id= "b1 "> </span>
<script language= "JavaScript ">
function choose(){
if(document.getElementById( "chb_01 ").checked)
{
document.getElementById( "b1 ").innerHTML= " <input type=\ "submit\ " name=\ "bb1\ "> ";
}
else
{
document.getElementById( "b1 ").innerHTML= " ";
}
}
</script>