I'm trying to do the HTML5 fundamentals tutorial and this is so far my code :
<!DOCTYPE html>
<head>
<script src="script.js"></script>
<title>HTML Fundamentals</title>
</head>
<body>
<div id="result" class="well"
<div id="log"> </div>
<hr />
<div class="item" id="div1">div 1</div>
<div class="item" id="div2">div 2</div>
<div class="item" id="div3">div 3</div>
<div class="item" id="div4">div 4</div>
<div class="item" id="div5">div 5</div>
<div class="item" id="div6">div 6</div>
<hr />
</div>
function initiate() {
var divs = document.querySelectorAll('div');
var log = document.querySelector('#log');
log.innerText = 'There are' + divs.length + 'DIVs on this page';
}
addEventListener("load", initiate);
But it does not show the message as i would like. Care to point out what i'm missing?
<div id="result" class="well"should have>at the end for starters:<div id="result" class="well">