How do I change multiple frames simultaneously with one click?

Jayesh Nazre

Every frame is considered to be a window object. So you can change the frames contents using all of the window objects functions.

Now all the frames in a window are considered to be in a collection array.

Say you have three frames fr1,fr2,fr3 .

You can access them using the following code
or as:
So if you want to change multiple frames, then in the onClick of a button call a JavaScript function (eg - test()) and change the frames as shown
<script language=test()>
function test() {
parent.frames["fr1"].location = "1.html";
parent.frames["fr2"].location = "1.html";
parent.frames["fr3"].location = "1.html";
or as:
<script language=test()>
function test() {
parent.frames[0].location = "1.html";
parent.frames[1].location = "1.html";
parent.frames[2].location = "1.html";
0 Comments  (click to add your comment)
Comment and Contribute






(Maximum characters: 1200). You have 1200 characters left.



About | Sitemap | Contact
We have made updates to our Privacy Policy to reflect the implementation of the General Data Protection Regulation.