我的 aspx 页面上有一个 asp:checkbox
和一个 asp:textbox
,我想知道在选中复选框时显示文本框,如果选中则隐藏它使用 javascript 取消选中复选框,我真的很感谢任何可以帮助我的人。
最佳答案
您可以使用此代码
<script type="text/javascript">
function radio_yes(){
if(document.getElementById("c1").checked==true)
document.getElementById("atext").style.visibility="visible";
else
document.getElementById("atext").style.visibility="hidden";}
</script>
<input type="checkbox" id = "c1" name="subscriptions" onclick = "radio_yes();radio_uncheck();" value="CorporateEmails"/>
Corporate Press Release Emails<br />
<input type="text" id="atext">
关于javascript - 如何检查 asp :Checkbox is checked and show or hide It using javascript?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/13216654/