I would rather use query than dom apis.  You could probably even use a CSS selector to get the anchor without specifying an id