Hi,
I want to remove the current DOM using tagName=DIV. Below function works fine in IE but not working properly in mozilla. The 'if' part is for IE and 'else' part is for mozilla FF. In 'else' part,The current DIV is not removing, only the DIV at position 1,that is the div at the first element in the array is removed.
Kindly anybody give me solution on how to remove the current childelement in mozilla.
function removeit(e)
{
if (window.event)
{
var current = window.event.srcElement;
while ( (current = current.parentElement) && current.tagName !="DIV");
current.parentElement.removeChild(current);
}
else
{
var current = e.target;
var element = document.getElementById("moreUploads"); // its a div
while (element.childNodes[0]) {
element.removeChild(element.childNodes[0]);
removeChildNodes(element); }
}
}