add IE8 support

IE8 uses Element in lieu of HTMLElement. If IE8 is in use, element is referenced to Element instead of HTMLElement