Check whether a variable is an HTMLElement