My problem is that when onclicktriggers the toggleNew function it\'s not executing but when I click the div a second time it\'s execut
onclick
toggleNew
div
e.style.display represents the style of the element defined by the style attribute, it does not give you the computed style. to get the computed style use
e.style.display
if (window.getComputedStyle(e,null).getPropertyValue("display") == 'block){