var idObject = document.getElementById(id);
if (idObject != null)
    idObject.parentNode.removeChild(idObject);
}