使用Javascript隐藏/显示单选按钮 [英] Radion Button Hide/Visible Using Javascript

查看:77
本文介绍了使用Javascript隐藏/显示单选按钮的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想在asp.net中使用javascript隐藏/可见单选按钮.我尝试一些代码无法正常工作.

代码:

可见单选按钮的代码

 文档 .getElementById('  RadioButton1').style.display = ' ';
 文档 .getElementById('  RadioButton1') .style.visibility = ' 可见';
文档 .all('  RadioButton1') .style.visibility = ' 可见'; 



单选按钮隐藏代码

 文档 .getElementById('  RadioButton1').style.display = '  none';
文档 .getElementById('  RadioButton1') .style.visibility = ' 隐藏';
文档 .all('  RadioButton1') .style.visibility = ' 隐藏';




可见代码可以正常工作,但是Invisble代码不能正常工作.这意味着单选按钮的文本不会隐藏,而是圈出(在单选按钮中)仅隐藏单选按钮是一个单独的元素.您将需要找到该元素并将其隐藏/显示.

彼得


I want hide/Visible Radio button using javascript in asp.net.I try some code its not working proper.

Code:

Code For Visible Radio Button

 document.getElementById('RadioButton1').style.display = '';
 document.getElementById('RadioButton1').style.visibility = 'visible';
document.all('RadioButton1').style.visibility = 'visible';



Code For Hide Radio Button

document.getElementById('RadioButton1').style.display = 'none';
document.getElementById('RadioButton1').style.visibility = 'hidden';
document.all('RadioButton1').style.visibility = 'hidden';




Visible code is working fine ,but Invisble code not working proper.Which mean Radio button text not hide but circle(In radio button) only hiding

解决方案

The caption for the radio button is a separate element. You will need to find that element and hide/display it as well.

Peter


这篇关于使用Javascript隐藏/显示单选按钮的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆