PHP
OOPs
JavaScript
JQuery
Ajax
Codeigniter
Laravel
MySql
Node.js
Tutorials
C
C++
Json
Codeigniter 4
htaccess
wordpress
react.js
Blogs
Fundamental
Python
Search Your Query
×
--- Select Category ---
PHP
OOPs
JavaScript
JQuery
Ajax
Codeigniter
Laravel
MySql
Node.js
Tutorials
Blogs
Fundamental
Python
Most Popular Tutorials
what is jquery
Document object model (DOM)
JQuery Syntax
jQuery Selectors
Get and set value in jquery
JQuery Attribute
Attribute Methods
jQuery - DOM Manipulation
Jquery events
JQuery Effects
Jquery Html/css Effects
jQuery Insert New Content
Auto hid Div
Jquery no conflict
JQuery Form validation
Html Form Validation
Login Form Validation
JQuery Fadeout Message
Jquery Modal popup
JQuery Ajax Form
Dynamic Dependent DropDown
Autocomplete list
Dynamic content load
Dynamic Star Rating
Drag and Drop Image Upload
show Hide Elements By click on checkbox
Add or Remove class in jquery
check Password strength
Count Remaining Character
check single or All checkboxes
Password match or not
Data Table
Date Picker
Multiselect Dropdown with Checkbox
Add Dynamic Input Field (Add More Input Field)
submit button disable after one click
Show hide password in Password textbox using checkbox
set content and value in html page
put value in the text field
sweet alert
Data-id
Tutorials Menus
what is jquery
Document object model (DOM)
JQuery Syntax
jQuery Selectors
Get and set value in jquery
JQuery Attribute
Attribute Methods
jQuery - DOM Manipulation
Jquery events
JQuery Effects
Jquery Html/css Effects
jQuery Insert New Content
Auto hid Div
Jquery no conflict
JQuery Form validation
Html Form Validation
Login Form Validation
JQuery Fadeout Message
Jquery Modal popup
JQuery Ajax Form
Dynamic Dependent DropDown
Autocomplete list
Dynamic content load
Dynamic Star Rating
Drag and Drop Image Upload
show Hide Elements By click on checkbox
Add or Remove class in jquery
check Password strength
Count Remaining Character
check single or All checkboxes
Password match or not
Data Table
Date Picker
Multiselect Dropdown with Checkbox
Add Dynamic Input Field (Add More Input Field)
submit button disable after one click
Show hide password in Password textbox using checkbox
set content and value in html page
put value in the text field
sweet alert
Data-id
Share On Facebook
How to show and hide elements using jquery?
show Hide Elements By click on checkbox in Jquery
File name : index.php
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>How to show Hide Elements By click on checkbox in Jquery </title>
<script src="https://code.jquery.com/jquery-1.12.4.min.js"></script>
<style type="text/css">
.box{
color: black;
display: none;
margin-top: 20px;
}
.check{
background: #ffffff;
}
</style>
</head>
<body>
<div>
<label><input type="checkbox" name="colorCheckbox" value="check"> Click on the check box</label>
</div>
<div class="check box">
<form method="post" action="" id="myfrm">
<fieldset>
<legend>Personal information:</legend>
First name:<br>
<input type="text" name="firstname">
<br>
Last name:<br>
<input type="text" name="lastname">
<br><br>
<input type="submit" value="Submit">
</fieldset>
</form>
</div>
<script type="text/javascript">
$(document).ready(function(){
$('input[type="checkbox"]').click(function(){
var inputValue = $(this).attr("value");
$("." + inputValue).toggle();
});
});
</script>
</body>
</html>
Output :-
How to show Hide Elements By click on checkbox in Jquery
Click on the check box
Personal information:
First name:
Last name:
Share On Facebook
Previous
Next
Trending Tutorials
PHP
100+ Tutorials
PHP OOPs
80+ Tutorial
Codeigniter
100+ Tutorial
Laravel
100+ Tutorials
NODE.JS
100+ Tutorials
Javascript
100+ Tutorials
Download Live Projects
Review & Rating
0.0
/ 5
0
Review
5
(
0
)
4
(
0
)
3
(
0
)
2
(
0
)
1
(
0
)
Write Review Here
Review
Submit Review
×
Submit
Ittutorial
Ittutorial
Most Popular Tutorials
Autocomplete list
Attribute Methods
set content and value in html page
Data Table
Add or Remove class in jquery
JQuery Fadeout Message
check single or All checkboxes
Multiselect Dropdown with Checkbox
check Password strength
jQuery Insert New Content
Add Dynamic Input Field (Add More Input Field)
Show hide password in Password textbox using checkbox
Drag and Drop Image Upload
put value in the text field
Dynamic Star Rating
Dynamic Dependent DropDown
show Hide Elements By click on checkbox
Jquery Html/css Effects
Password match or not
JQuery Attribute
Important Link
Core php Online Advance Tutorails and video Tutorials.
How to manage Session in php Tutorials.
More .......
upcomming codeigniter and angular js tutorials.
Click here to see More ...
Hello Friend Please Follow & Share Ittutorial.
×
Ittutorial
Please Follow and Share ittutorial.
Ittutorial