EddyG
EddyG

Reputation: 2129

Preserve anchor style if it doesn't have href attribute

I have an anchor element that I use with a button role, so I am not using href attribute on it.

<a (click)="doSomething()" role="button">Some data></a>

By default in Bootstrap, if no href is set on an anchor element it loses its style (default blue color, underline, hover...).

How can I preserve the Bootstrap style for an anchor that does not have href attribute?

Upvotes: 3

Views: 79

Answers (1)

Charlene Vas
Charlene Vas

Reputation: 731

Try using this: <a href="javascript:void(0);></a>

Upvotes: 3

Related Questions