Home > Web Front-end > JS Tutorial > body text

Use RadioButten or CheckBox to display and hide divs_javascript skills

WBOY
Release: 2016-05-16 17:22:03
Original
1385 people have browsed it

When "Female" is selected, "Beauty, Talented Woman" is displayed; when "Male" is selected, the aspx page content is hidden:

Copy code The code is as follows:


Use RadioButten (or CheckBox) to display and hide div





Male
Female
<%-- Female--%>





cs page code:
Copy the code The code is as follows:

protected void Page_Load(object sender, EventArgs e)
{
this.Radio2.Checked = true;
if (this.Radio2.Checked)
this.nvInfo.Attributes.CssStyle.Add("display", "block"); //Add CSS style attributes from .cs to the HTML control in .aspx
if (this.Radio1.Checked)
this.nvInfo.Attributes.CssStyle.Add("display", "none"); //Add CSS style attributes from .cs to the HTML control in .aspx
}
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template