OnClick change div

Developer
Size
1,979 Kb
Views
52,624

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 Previews

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"); }; });
})
OnClick change div - Script Codes
OnClick change div - Script Codes
Home Page Home
Developer Kanha Sahu
Username kaslab
Uploaded August 27, 2022
Rating 3
Size 1,979 Kb
Views 52,624
Do you need developer help for OnClick change div?

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!

Kanha Sahu (kaslab) Script Codes
Create amazing SEO content with AI!

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!