Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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?

like image 945
EddyG Avatar asked Nov 24 '25 04:11

EddyG


1 Answers

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

like image 194
Charlene Vas Avatar answered Nov 26 '25 19:11

Charlene Vas



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!