www.webdeveloper.com
Results 1 to 4 of 4

Thread: Click on hyperlink and display .htm in iframe

  1. #1
    Join Date
    Jun 2003
    Posts
    2

    Click on hyperlink and display .htm in iframe

    I want to be able to display a .htm page in an iframe when a hyperlink is clicked. I wrote the following script but only the file icons in that directory were displayed. What I want is to display the content in a particular page.
    Anyone has an idea on how to achieve that ?

    <html>
    <body>
    <a href="" onClick="parent.frame1.location='Interest.htm'">Click to display interests</a>

    <p>

    <iframe name="frame1"></iframe>
    </body>
    </html>

  2. #2
    Join Date
    Dec 2004
    Posts
    8,637
    No JavaScript required:

    <a href="Interest.htm" target="frame1">Click to display interests</a>

  3. #3
    Join Date
    Jun 2003
    Posts
    2
    Thanks.

  4. #4
    Join Date
    Dec 2004
    Posts
    8,637
    You're welcome.

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Posting Permissions

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



Recent Articles