fixed HTMLElement check to be compatible with IE8

very small patch for IE8