controlling IFRAME with JavaScript

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

hello,

how can i change the page displayed in an <iframe> element using JavaScript?

(in JavaScript, not the 'target' property of the <a> tag please)

thanks,

Xero
 
Give the frame an ID and name. Ex: id="myFrame" name ="myFrame". Then you
can access it via JavaScript. Ex:

document.frames("myFrame").src = "nextpage.htm"
or
document.all.myFrame.src = "nextpage.htm";
 
Back
Top