onClick to link to ID of element

I would like it go to the element like you would do with an anchor, but without using an anchor.