#2234: Declare local variable

IE11 needs local variable to be declared
#2234: Fix test typo

IE11 do not have endEvent.target.classList so do not run right side of
the test