Javascript examples for DOM:Element addEventListener
Handle DOM node inserted event action
<html> <head> <meta name="viewport" content="width=device-width, initial-scale=1"> <script type="text/javascript"> window.onload=function(){//from ww w.ja va2s . co m document.body.addEventListener('DOMNodeInserted', function(e) { console.log('div height=' + e.target.clientHeight) }); d = document.createElement("div"); d.appendChild(document.createTextNode("hello")); t = document.body.appendChild(d); } </script> </head> <body> </body> </html>