实现选择radio按钮后添加一个文本输入框的示例

来源:互联网 发布:淘宝吉林市船营区法院 编辑:程序博客网 时间:2024/05/06 20:58

实现选择radio按钮后添加一个文本输入框:


<input type="radio"  name="c_guomin"   value="yes" style="align: bottom;margin-left:20pt;margin-right:10pt"

onclick="document.getElementById('gmwp').style.display='';document.getElementById('label').style.display='' " />有      
<input type="radio"  name="c_guomin"   value="no" style="align: bottom;margin-left:20pt;margin-right:10pt" 
onclick="document.getElementById('gmwp').style.display='none';document.getElementById('label').style.display='none';
document.getElementById('gmwp').value=''"/>没有


<div style="font-family:microsoft yahei;font-size:22pt;padding-left:50pt;padding-top:10pt;color:#4F4F4F"> 
<label id="label" style="display:none" >请输入名称:<br></label>
<input class="input_b01" type="text" name="c_guomin_name" id="gmwp" style="display:none"
style="align: bottom;margin-left:20pt;margin-right:10pt;margin-top:10pt"  />
 </div>


效果如下:



0 0