It's getElement s ByTagName
, with an s
, and using addEventListener will give this
the right value, also note the way the style is set
news_divs[i].addEventListener('click', function() {
var child = this.getElementsByTagName('div')[0];
child.style.display = "block";
}, false);