Generally, the only time you should use an <a> tag in TiddlyWiki is for external links. Otherwise, <$link> makes more sense, as this handles some functionality for you, like adding the # and applying appropriate styles if the tiddler is missing, a shadow tiddler, etc.
As for why what you did didn't work, this is never valid syntax in TiddlyWiki:
attribute="text{{transclusion}}"
Within attributes, transclusions are not evaluated within quotes. Thus, the value of an attribute can be either a constant value in quotes, or a transclusion (<<variable>>, {{field}}, or {{{filtered}}}) -- not both. If you need to concatenate several things in the value of an attribute, you can use either a macro with text substitution:
\define concat() text$(transclusion)$
<$set transclusion={{transclusion}}>
<$widget attribute=<<concat>>/>
</$set>
Or a filtered transclusion:
<$widget attribute={{{ [[text]addsuffix{transclusion}] }}}/>