Updated to allow for HTMLElement as well as ID

Updated to allow for HTMLElement as well as ID