faqts : Computers : Programming : Languages : JavaScript : Frames

+ Search
Add Entry AlertManage Folder Edit Entry Add page to http://del.icio.us/
Did You Find This Entry Useful?

10 of 19 people (53%) answered Yes
Recently 6 of 10 people (60%) answered Yes

Entry

How can an onclick event swap an image in another frameset

Dec 6th, 2001 13:58
Arsen Yeremin, deveda freaker,


<html>
<head>
  <title>Frame a</title>
  <script>
function Swapit()
{
   parent.window.frames
['my_frame_b'].document.images.my_image.src= "http://www.cnn.com/2001/TE
CH/space/12/06/space.shuttle.ap/top.launched.wed.jpg";
}  
  </script>
</head>
<body>
  <a href="javascript:Swapit()">swap</a>
  <img name="my_image" 
src="http://www.cnn.com/2001/HEALTH/12/06/pain.pleasure.reut/top.brain.j
pg">
</body>
</html>