The name attribute is obsolete. Consider putting an id attribute on the nearest container instead
I prefer to jump users to heading tags (following MediaWiki's default behavior) where in-page links are needed, but yes, you could address the ID of any element.