non-hyperlink clickable text?

R

Richard

Is it possible to create clickable text that does not redirect the browser
to another URL? I'm trying to use the <A> tag strictly for triggering a
javascript function but this seems impossible because it will not create
hypertext unless there is a URL specified.. and that just screws things up.
Is the a way around this? I'm writing in ASP.NET if that makes a difference.
Thanks in advance for your help.

Regards,
Richard
 
N

Noozer

Richard said:
Is it possible to create clickable text that does not redirect the browser
to another URL? I'm trying to use the <A> tag strictly for triggering a
javascript function but this seems impossible because it will not create
hypertext unless there is a URL specified.. and that just screws things up.
Is the a way around this? I'm writing in ASP.NET if that makes a difference.
Thanks in advance for your help.

<a href="#" onclick="dosomething(); return(false);">Some text here</a>

....or something very close to that.
 
M

Mark Parnell

Previously in alt.html said:
<a href="#" onclick="dosomething(); return(false);">Some text here</a>

But be aware that anyone with Javascript disabled/unavailable will
probably just get taken to the top of the page. Better to write the
above on the page with Javascript in the first place, so that those
without Javascript don't even see the link.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,744
Messages
2,569,483
Members
44,902
Latest member
Elena68X5

Latest Threads

Top