I use a similar technique when I'm using an anchor to do a button's job: if the anchor's href is an undefined hash name, the page should not reload and the user should not be brought back up to the top of the page.
<a href="#">CLICK ME</a>
That "#" refers to the current page, and in every browser I know makes a page refresh, which brings focus to the top of the page.
To prevent this, I do something like
<a href="#void">CLICK ME</a>
Void is not a defined id or name attribute anywhere on my page, so #void is an invalid link. Most browsers will hold the focus on that link and not go to another page nor will they refresh the page.
However webkit browsers will not necessarily keep the focus on what was clicked, in contrast to Opera, Firefox and I think IE. They'll hold the focus on the last-clicked thing until the user clicks elsewhere. By focus I mean keyboard focus... visual focus won't change, and the user will stay on the right part of the page visually.
If I'm using an anchor as an in-page destination, and I don't want the user to get thrown to the top of the page if they somehow manage to click the destination, I match the id and the href:
to use Dresden's example but with an anchor for destination instead of a div
Like that. I would only use an anchor as destination though if a focusable destination were required.