Want the hyperlink pointer finger to appear on anchor text without the href attribute.

I have anchor text that calls JavaScript when clicked.  Because the anchor lacks an href attribute, the anchor text doesn't show the characteristic hyperlink behavior (underlined text, and the pointer finger when the cursor is over the text).  I don't need the underline, but I would like to see the pointer finger.  How do I accomplish this?
jdanaAsked:
Who is Participating?

[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More

x
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Tomarse111Commented:
add style="cursor: pointer;" to your anchor tag styles :)
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
Michel PlungjanIT ExpertCommented:
Why not add the href???
<a href="#"
onClick="someFunction(); return false">Click</a>

is much more compatible and gives you the finger for free ;)
0
Tomarse111Commented:
if your going to add the href then shouldn't you add something along the lines of:

<a href="javascript:void(0)" onclick="someFunction();">

instead of the #? This would get around the the whole page bouncing to the top of the window scenario.

:-)
0
Michel PlungjanIT ExpertCommented:
No.

The return false on the onClick will stop that and the # only loaded if JS is turned off. IF js is turned off or not available, then javascript:void(0) will give a nasty http error


the BETTER solutions are


<script>
document.write('<a href="#" onClick="someFunction(); return false">Click</a>')
</script>
 
or 
 
<a href="please_turn_on_javascript_for_this_link_to_work.html"
onClick="someFunction(); return false">Click</a>

Open in new window

0
jdanaAuthor Commented:
style="cursor: pointer;" is perfect.  Thanks.
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
HTML

From novice to tech pro — start learning today.