<html> <script> function appel(quoi) { alert(quoi.tagName); for ( var n=0; n<quoi.childNodes.length; n++ ) { appel(quoi.childNodes[n]); } } appel(document.getElementsByTagName('html')[0]); </script> </html>vous verrez qu'avec certains navigateurs
<html> <script> startCall_arr =new Array(); function startCall(quoi){ startCall_arr=new Array(); appel(quoi); return startCall_arr; } function appel(quoi) { if(quoi.nodeType==1) { startCall_arr.push(quoi); for ( var n=0; n<quoi.childNodes.length; n++ ) { appel(quoi.childNodes[n]); } } } alert(startCall(document.getElementsByTagName('html')[0])); </script> </html>
Vous n’avez pas trouvé la réponse que vous recherchez ?
Posez votre question