I actually prefer javascript:; since using # usually scrolls the page to the
top which can be really annoying. If it's not a real link I don't see what
the problem is there.

Now, if it's an actual link that you're wanting to apply an onclick function
to, you should use the onclick="javascript:return myfunc();" attribute, use
the normal URL in the href="", and then return true/false from myfunc()
depending on whether or not you want to link to be activated by the click.

On 2/16/07, hcabbos <[EMAIL PROTECTED]> wrote:

What's the best way to apply a behavior to an anchor tag?

<a href="#" class="someClass">my text</a>

-- or --

<a href="javascript:;" class="someClass">my text</a>

_______________________________________________
jQuery mailing list
[email protected]
http://jquery.com/discuss/


_______________________________________________
jQuery mailing list
[email protected]
http://jquery.com/discuss/

Reply via email to