How do i go to particular anchor on Page Load ?

Discussion in 'JavaScript' started by i'm, Sep 5, 2010.

  1. #1
    Hello Again,

    I have another problem.How do i make such a javascript that when the page loads it automatically goes to a particular anchor like for ex. <a href="#myanchor">.

    So how do i do this ?

    Thank You.
     
    i'm, Sep 5, 2010 IP
  2. Cash Nebula

    Cash Nebula Peon

    Messages:
    1,197
    Likes Received:
    67
    Best Answers:
    0
    Trophy Points:
    0
    #2
    
    <body onload=' location.href="#myanchor" '>
    <a id='myanchor' href='#'>anchor text</a>
    
    Code (markup):
     
    Cash Nebula, Sep 5, 2010 IP
  3. i'm

    i'm Peon

    Messages:
    44
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0