JSFiddle - React, Tailwind, and code Playground
by Karan1412
HTML
<html>
<head>
<title>remove</title>
</head>
<body>
<p id="targetP" class="default">This is p element.</p>
<div id="targetDiv" class="default">This is div element.</div><br />
<input type="button" id="removeId" value="Remove using Id selector"/>
<input type="button" id="removeClass" value="Remove using Class selector"/>
<input type="button" id="reset" value="Reset" onclick="location.reload()" />
</body>
</html>
JavaScript
$(document).ready(function () {
$("#removeId").click(function () {
$("#targetP").remove();
$("#targetDiv").remove();
});
$("#removeClass").click(function () {
$(".default").remove();
});
});