I am new to javascript and I have a basic question for a simple task. I am trying to show or hide checkbox when the label is clicked
I am having five Checkbox
How to write a Javascript when Label is clicked five checkbox should display?
Help
Know the answer? Post it — somebody with the same question will find it here.
Sign in to answer this question
It is the same account you read, post and publish with — and you will come straight back to this page.
Govinda Rajulu YemineniPosted Aug 14, 2015, 7:50 AM
Sumit JoshiPosted Aug 14, 2015, 6:34 AM
Upendra Pratap ShahiPosted Aug 14, 2015, 6:20 AM
Sumit JoshiPosted Aug 14, 2015, 6:17 AM
Put Javascript in
tag insideHTML
Upendra Pratap ShahiPosted Aug 14, 2015, 6:16 AM
Sumit JoshiPosted Aug 14, 2015, 6:05 AM
Sumit JoshiPosted Aug 14, 2015, 6:03 AM
Upendra Pratap ShahiPosted Aug 14, 2015, 6:00 AM
Sumit JoshiPosted Aug 14, 2015, 5:20 AM
<%@ Page Language="C#" AutoEventWireup="true"CodeFile="hidecheckboxonlable.aspx.cs" Inherits="hidecheckboxonlable" %>
DOCTYPE html>
<html>
<head id="Head1" runat="server">
<title>title>
<script src="https://code.jquery.com/jquery-2.1.4.min.js">script>
<script type="text/javascript">
$(document).ready(function ()
{
$('#lblForshow').hide();
$('#lblForHide').click(function () {
$('.hide').hide();
$('#lblForHide').hide();
$('#lblForshow').show();
});
$('#lblForshow').click(function () {
$('#lblForHide').show();
$('.hide').show();
$('#lblForshow').hide();
});
});
script>
head>
<body>
<form id="form1" runat="server">
<div>
<asp:Label ID="lblForHide" runat="server" Text="Click me for see checkboxed hide">asp:Label><br />
<asp:CheckBox ID="CheckBox1" runat="server" class="hide" Text="AAA" /><br />
<asp:CheckBox ID="CheckBox2" runat="server" class="hide" Text="BBB" /><br />
<asp:CheckBox ID="CheckBox3" runat="server" class="hide" Text="CCC" /><br />
<asp:CheckBox ID="CheckBox4" runat="server" class="hide" Text="DDD" /><br />
<asp:CheckBox ID="CheckBox5" runat="server" class="hide" Text="EEE" /><br />
<asp:Label ID="lblForshow" runat="server" Text="Click me for see checkboxed hide">asp:Label><br />
div>
form>
body>
html>
If it is helpful for you Accept as answerUpendra Pratap ShahiPosted Aug 14, 2015, 5:14 AM
Rahul PrajapatPosted Jul 8, 2015, 11:22 PM
Upendra Pratap ShahiPosted Jul 8, 2015, 8:33 AM
<%@ Page Language="C#" AutoEventWireup="true" CodeFile="hidecheckboxonlable.aspx.cs" Inherits="hidecheckboxonlable" %>
DOCTYPE html>
<html>
<head id="Head1" runat="server">
<title>title>
<script src="https://code.jquery.com/jquery-2.1.4.min.js">script>
<script type="text/javascript">
$(document).ready(function ()
{
$('#lblForshow').hide();
$('#lblForHide').click(function () {
$('.hide').hide();
$('#lblForHide').hide();
$('#lblForshow').show();
});
$('#lblForshow').click(function () {
$('#lblForHide').show();
$('.hide').show();
$('#lblForshow').hide();
});
});
script>
head>
<body>
<form id="form1" runat="server">
<div>
<asp:Label ID="lblForHide" runat="server" Text="Click me for see checkboxed hide">asp:Label><br />
<asp:CheckBox ID="CheckBox1" runat="server" class="hide" Text="AAA" /><br />
<asp:CheckBox ID="CheckBox2" runat="server" class="hide" Text="BBB" /><br />
<asp:CheckBox ID="CheckBox3" runat="server" class="hide" Text="CCC" /><br />
<asp:CheckBox ID="CheckBox4" runat="server" class="hide" Text="DDD" /><br />
<asp:CheckBox ID="CheckBox5" runat="server" class="hide" Text="EEE" /><br />
<asp:Label ID="lblForshow" runat="server" Text="Click me for see checkboxed hide">asp:Label><br />
div>
form>
body>
html>
Munesh SharmaPosted Jul 8, 2015, 8:13 AM
Raja TPosted Jul 8, 2015, 7:38 AM
Deepak RatanPosted Jul 8, 2015, 7:14 AM
Raja TPosted Jul 8, 2015, 7:09 AM
Deepak RatanPosted Jul 8, 2015, 6:23 AM
Raja TPosted Jul 8, 2015, 6:15 AM
Deepak RatanPosted Jul 8, 2015, 6:10 AM
Raja TPosted Jul 8, 2015, 5:37 AM
Posted Jul 8, 2015, 5:24 AM