SitePoint Sponsor

User Tag List

Results 1 to 2 of 2

Hybrid View

  1. #1
    SitePoint Zealot
    Join Date
    Nov 2005
    Posts
    113
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    problem with IE7: onclick="return false" doesn't work?

    Is it just me or has IE7 stopped supporting <a href="#" onclick="return false">Hot</a>

    I have to resort to <a href="javascript: void(0)">Hot</a>, which is a problem if I wanted to place an actual hyperlink into the href in case user does not have javascript turned on? Why doesn't onclick="return false" work in IE7?

    It can't be due to the doctype declaration on the page right?

  2. #2
    CSS & JS/DOM Adept bronze trophy
    Join Date
    Mar 2005
    Location
    USA
    Posts
    5,482
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    It works fine in IE7 for me.

    It's best to avoid using inline event handlers. I suggest you read up on JavaScript Best Practices
    We miss you, Dan Schulz.
    Learn CSS. | X/HTML Validator | CSS validator
    Dynamic Site Solutions
    Code for Firefox, Chrome, Safari, & Opera, then add fixes for IE, not vice versa.


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •