click() method and Firefox

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Aziz

    #1

    click() method and Firefox

    hi,

    with the following anchor objeck: <a id="ref" href.......>... </a>
    this code:
    document.getEle mentById("ref") .click();
    works on IE 6 but not on Firefox 1.0
    the error message is: document.getEle mentById("ref") .click is not a
    function..
    I'll be happy if you could tell me why and how to solve?

    Thanks
  • Lee

    #2
    Re: click() method and Firefox

    Aziz said:[color=blue]
    >
    >hi,
    >
    >with the following anchor objeck: <a id="ref" href.......>... </a>
    >this code:
    >document.getEl ementById("ref" ).click();
    >works on IE 6 but not on Firefox 1.0
    >the error message is: document.getEle mentById("ref") .click is not a
    >function..
    >I'll be happy if you could tell me why and how to solve?[/color]

    Instead, use this code:

    location="whate ver the href value of that link happens to be";

    Comment

    • happymonster

      #3
      Re: click() method and Firefox

      Try the following:
      <a id="ref" href="new.html" onclick="locati on.href='new.ht ml'">...</a>

      document.getEle mentById("ref") .onclick();

      This will work in Firefox.


      Comment

      Working...