×
×
How to remove the div or element using jquery
How to remove the div or element using jquery
Published Dec 19,2022 by Kailash Singh
0 Comment 953 Views
In this tutorail, you will be learning how to remove the div tag or html element using jQuery.
We will be using jQuery remove() method to remove that exact html element using jQuery as given below example:
Source Code:
<!DOCTYPE html>
<html lang="en">
<head>
<title>How to remove the div or element using jquery - Elevenstech Web Tutorials</title>
</head>
<body>
<div id="myDivSection">
<h4>Hello Guys, You are going to remove this div</h4>
<p>This is a paragraph</p>
</div>
<button type="button" id="myButton">Click to remove</button>
<script src="https://code.jquery.com/jquery-3.6.0.min.js"></script>
<script>
$(document).ready(function () {
$("#myButton").click(function() {
$("#myDivSection").remove();
});
});
</script>
</body>
</html>
Comments ( 0 )
Elevenstech Web Tutorials
Elevenstech Web Tutorials helps you learn coding skills and enhance your skills you want.
As part of Elevenstech's Blog, Elevenstech Web Tutorials contributes to our mission of “helping people learn coding online”.
Read More
Newsletter
Subscribe to get the latest updates from Elevenstech Web Tutorials and stay up to date
Copyright 2018 - 2024 Elevenstech Web Tutorials All rights reserved.