SitePoint Sponsor

User Tag List

Results 1 to 3 of 3
  1. #1
    SitePoint Enthusiast
    Join Date
    Feb 2007
    Posts
    37
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Hit on a hyperlink

    How can i make my browser to click on the only link that the page has in one picture?

    Note, the link changes everytime the page is loaded, so js needs to click the picture, like the user would do with his cursor.

  2. #2
    SitePoint Wizard
    Join Date
    Nov 2004
    Location
    Nelson BC
    Posts
    2,310
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Code:
    window.onload = function () {
      document.getElementById("clickThis").click();
    }
    ....
    <a href="somelink.html" id="clickThis"><img...></a>

  3. #3
    SitePoint Enthusiast
    Join Date
    Feb 2007
    Posts
    37
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Cool. Thanks!


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
  •