I\'m trying to select elements with .getElementsByTagName()
.
var tags = document.body.getElementsByTagName(\"*\");
Current attemp
Function examples:
Page loaded with pure JavaScript
Page loaded with jQuery
Example with both methods:
function init() {
alert("hello javascript");
};
window.addEventListener("load",init,false);
$(document).ready(function () {
alert("hello jQuery");
});
http://jsfiddle.net/Ln5zu4Lt/
Be careful, the JavaScript example above waits for page load (images, iframes, etc.). This takes more time than jQuery's ready.