Toggle visibility of element when checkbox is checked/unchecked
How do I make an toggle visibility of element when checkbox is checked/unchecked?
What is a toggle visibility of element when checkbox is checked/unchecked? How do you make a toggle visibility of element when checkbox is checked/unchecked? This script and codes were developed by Mia Sno on 12 August 2022, Friday.
Toggle visibility of element when checkbox is checked/unchecked - Script Codes HTML Codes
<!DOCTYPE html>
<html >
<head> <meta charset="UTF-8"> <title>Toggle visibility of element when checkbox is checked/unchecked</title> <link rel="stylesheet" href="css/style.css">
</head>
<body> <label for "chkBox">Check me</label>
<input type="checkbox" class="chkBox" name="chkBox" />
<div class="toggledelement">
Hey I'm visible now!
</div> <script src='http://cdnjs.cloudflare.com/ajax/libs/jquery/2.1.3/jquery.min.js'></script> <script src="js/index.js"></script>
</body>
</html>
Toggle visibility of element when checkbox is checked/unchecked - Script Codes CSS Codes
.toggledelement { display: none; color: red; font-weight: bold;
}
Toggle visibility of element when checkbox is checked/unchecked - Script Codes JS Codes
$(document).ready(function()
{
//make initial check state unchecked
$('.chkBox').prop('checked', false);
//when clicking on checkbox, toggle the visibility of another element
$(".chkBox").click(function() {
$(".toggledelement").slideToggle(500); });
});
Developer | Mia Sno |
Username | mrs_snow |
Uploaded | August 12, 2022 |
Rating | 3 |
Size | 1,824 Kb |
Views | 48,576 |
Find the perfect freelance services for your business! Fiverr's mission is to change how the world works together. Fiverr connects businesses with freelancers offering digital services in 500+ categories. Find Developer!
Name | Size |
Smooth Scroll To Anchor With jQuery | 1,976 Kb |
Sample fancybox 2 overlay with no wrapper and custom close | 1,937 Kb |
Sticky Navigation or Section with jQuery | 2,297 Kb |
Img Swap on hover or mouseover with JQuery | 1,561 Kb |
Placeholder sample for IE | 2,578 Kb |
Add id to body tag based on url jQuery | 1,501 Kb |
Toggle graph phases with menu of phases | 3,030 Kb |
QA list with content property | 1,628 Kb |
Print element on a page | 2,081 Kb |
Jasper is the AI Content Generator that helps you and your team break through creative blocks to create amazing, original content 10X faster. Discover all the ways the Jasper AI Content Platform can help streamline your creative workflows. Start For Free!
Name | Username | Size |
A Pen by Eka Risyana | Risyana | 3,705 Kb |
Disable JavaScript execution from console | Ludviglindblom | 2,534 Kb |
Hard-Stop Gradients | Mackdoyle | 2,288 Kb |
Transition | Shayhowe | 1,632 Kb |
Marching Squares Visualized | Sakri | 7,074 Kb |
Cartoon Bomb | Tcmulder | 4,929 Kb |
Degree Picker | Idered | 4,307 Kb |
Wikipedia Viewer | Thomasvaeth | 2,549 Kb |
Obligatory CSS3 UI Nav | Romandiaz | 9,017 Kb |
Fading gradient button | Insprd | 1,713 Kb |
Surf anonymously, prevent hackers from acquiring your IP address, send anonymous email, and encrypt your Internet connection. High speed, ultra secure, and easy to use. Instant setup. Hide Your IP Now!