Código:
function removeAllChilds(a)
{
var a=document.getElementById(a);
while(a.hasChildNodes())
a.removeChild(a.firstChild);
}
Aquí un ejemplo:
Código HTML:
<html>
<head>
</head>
<body>
<div id="a">
<span id="1">111111111111111111</span>
<div id="2">22222222222222222222</div>
<strong>aasdad</strong>
</div>
<script type="text/javascript">
function removeAllChilds(a)
{
var a=document.getElementById(a);
while(a.hasChildNodes())
a.removeChild(a.firstChild);
}
removeAllChilds('a');
</script>
</body>
</html>
para que usarlo? Pues para alternativa a innerHTML=''
;)