Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Dummy link in HTML to load dialog

Tags:

html

jquery

How to create a dead link in html.

I need to provide a "link" in my webpage that just opens up a jquery dialog. I cannot provide a href since it loads the page. I just want the link to appear like a link. So I tried with the following.

<a id='opener_guid' > Click here to load jquery message box</a>

The jquery load works well, but the link just appears as a simple text. User has no clue that it is clickable. How to solve this?

like image 271
Nemo Avatar asked Dec 04 '25 03:12

Nemo


2 Answers

Just add a href to nowhere to make the anchor a link

<a id='opener_guid' href="#" > Click here to load jquery message box</a>

Then to prevent navigating to yourpage.ext#, you can return false on click, and/or call preventDefault()

like image 87
bizzehdee Avatar answered Dec 06 '25 19:12

bizzehdee


<a id="link" href="#">Your text here<a/>
like image 32
Vinay Pratap Singh Bhadauria Avatar answered Dec 06 '25 18:12

Vinay Pratap Singh Bhadauria



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!