<!DOCTYPE html>
<html>
<head>
<script type='text/javascript'>
window.onload=function(){
var element = document.getElementById("testDiv");
console.log("By Id: " + element.innerHTML);
var element2 = document.getElementsByTagName("div");
console.log("By Tag Name: " + element2[0].innerHTML);
}
</script>
</head>
<body>
<div id="testDiv" name="testHolder">Test Content</div>
</body>
</html>