Hello reader's,
Below is the example to Remove the HTML element using Jquery
If you having trouble with such issues, then use the below code.
Here is the HTML
<p>Write your text here.</p>
<p>Write your text here.</p>
<p>Write your text here.</p>
<div class="img-box">
<img src="http://jp-australia.com/2013/sup/wp-content/themes/jp-australia/img/rider_profile-image_dummy.png">
</div>
<button class="remove">Remove the dummy test</button>
Here is the css
img{
max-width:100%;
height:auto;
}
.demo {
color: green;
font-size: 25px;
}
.img-box{
width:150px;
height:150px;
overflow:hidden;
}
.remove{
margin-top:20px;
padding:5px;
}
p
{
margin-bottom:15px;
border:1px solid #000;
}
Here is the js
$(function(){
$("p").click(function(){
$(this).remove();
});
$(".remove").click(function(){
$(".img-box").remove();
});
})
;
0 Comment(s)