What is the reason behind the output being 0 in this code?
<p id="g">
<div>kk</div>
<div>ee</div>
<div>jff</div>
</p>
<script type="text/javascript">
var ii = document.getElementById("g");
var hh = ii.getElementsByTagName('div');
document.write(hh.length);
</script>