jQuery - Remove Elements
$( ".hello" ).remove();
<!DOCTYPE html>
<html>
<head>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.5.1/jquery.min.js"></script>
<script>
$(document).ready(function(){
$("button").click(function(){
$("#div1").remove();
});
});
</script>
</head>
<body>
<div id="div1" style="height:100px;width:300px;border:1px solid black;background-color:yellow;">
This is some text in the div.
<p>This is a paragraph in the div.</p>
<p>This is another paragraph in the div.</p>
</div>
<br>
<button>Remove div element</button>
</body>
</html>.remove("#elemnt_id .elemnt_class");
Also in JavaScript:
- stopper un intervalle javascript
- double click on element using javascript
- How to parse POST requests with express nodejs
- js get the week monday to friday date
- javascript sum array of objects
- relative width and height image react native
- node log centered
- how to get the index of an array in javascript
- jquery attr multiple attributes
- classic asp get json from url
- add line break in innerhtml
- number of edges between set of nodes networkx
- regex to check if string contains special characters javascript
- input img
- function inside a class component react
- nextjs reportWebVitals function
- how map work in react
- react duration picker
- react native gifted chat
- node sudo nvm
- angular guard redirect
- javascript convert array of objects to array of uri
- sweet alert add custom button
- react prototype function