Updated to take id or htmlelement as param

Now takes a string ID OR HTMLElement as parameter for target