Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What does href=javascript:{} do?

What is the reason for using javascript:{} in the code below. Is it similar to href="javascript:" or href="javascript:void(0)"?

<a href="javascript:{}">This is an example</a>
like image 238
Jim_Joat Avatar asked Jul 19 '26 02:07

Jim_Joat


1 Answers

Let hyperlink look like a link but didn't link anything.

<a href="javascript:{}">This is an example</a>

if you remove href attribute, that a tag will be normal text.

like image 87
D-Shih Avatar answered Jul 21 '26 16:07

D-Shih



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!