OnClick change div
How do I make an onclick change div?
Using jquery toggle onclick change the div display property. What is a onclick change div? How do you make a onclick change div? This script and codes were developed by Kanha Sahu on 27 August 2022, Saturday.
OnClick change div - Script Codes HTML Codes
<!DOCTYPE html>
<html >
<head> <meta charset="UTF-8"> <title>onClick change div</title> <link rel='stylesheet prefetch' href='https://maxcdn.bootstrapcdn.com/bootstrap/3.3.6/css/bootstrap.min.css'> <link rel="stylesheet" href="css/style.css">
</head>
<body> <div class="container">
<p align="center" style="margin:3em 0 1em 0">
<button class="btn btn-primary" id="checkInToggleSystem">Ckeck In</button>
</p>
<div class="clearfix margin"></div>
<div class="well well-sm"> <div id="div1" class=" ">Now showing "Div 1" </div> <div id="div2" class=" ">Now showing "Div 2" </div>
</div>
</div> <script src='https://code.jquery.com/jquery-2.2.4.min.js'></script>
<script src='https://maxcdn.bootstrapcdn.com/bootstrap/3.3.6/js/bootstrap.min.js'></script> <script src="js/index.js"></script>
</body>
</html>
OnClick change div - Script Codes CSS Codes
#div1 { display: inline; color:blue;
}
#div2 { display: none; color:red;
}
.display-none { display: none !important;
}
.display-inline { display: inline !important;
}
OnClick change div - Script Codes JS Codes
$(function(){ $("#checkInToggleSystem").click(function () { $("#div1").toggleClass("display-none"); $("#div2").toggleClass("display-inline"); // change label if ($(this).text() == "Ckeck In") { $(this).text("Check Out"); } else { $(this).text("Ckeck In"); }; });
})
Developer | Kanha Sahu |
Username | kaslab |
Uploaded | August 27, 2022 |
Rating | 3 |
Size | 1,979 Kb |
Views | 52,624 |
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 |
Bootstrap Navigation | 2,293 Kb |
Rainbow hr | 1,743 Kb |
KASLAB Admin Panel login | 4,722 Kb |
Stylish Login Panel using SCSS | 3,620 Kb |
Material design tab style | 2,486 Kb |
Dynamicdrive marquee II | 2,759 Kb |
CSS3 checkbox with html properties, font awesome | 1,789 Kb |
Dynamic HTML control add and remove | 2,172 Kb |
Select all using Jquery Function | 2,816 Kb |
Responsive Jquery Navigation | 2,547 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 |
SnappySnippet Test | Elmsoftware | 8,385 Kb |
CSS Infinite 360 | APinix | 5,564 Kb |
Getting Started | Viblast | 1,500 Kb |
AngularJS Skills | Supro | 3,312 Kb |
Tree growth tests | Orchard | 3,818 Kb |
Dragonball Dragon Radar | DouglasGlover | 2,157 Kb |
Donald Trump - The New Yorker | Agbales | 2,502 Kb |
Review test | Otro_user_gil | 4,054 Kb |
Weather App | OmranAbazid | 2,596 Kb |
Flat buttons for Eliassen.com | Kdooley89 | 1,737 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!