javascript - Delete only the particular Div Id -


<div id="@("bottomgrid)" class="dgd2"></div> 
var element = document.getelementbyid("#bottomgrid"); element.empty();  $('.dgd2').empty() 

instead of deleting bottom grid removing other div present in screen.

if have html structure this:

<div class="holder">     <div id="item1">hey</div> </div> 

you can use pure javascript code remove "item1" element:

var element = document.getelementbyid("item1"); element.parentnode.removechild(element); 

Comments

Popular posts from this blog

sql - invalid in the select list because it is not contained in either an aggregate function -

Angularjs unit testing - ng-disabled not working when adding text to textarea -

How to start daemon on android by adb -