JavaScript Window frames Tutorial

In this section, we will learn what the window frames property is and how to use it in JavaScript.

JavaScript Window frames Property

This property will return an array-like object that contains all the direct `iframe` elements in the current HTML document.

Basically, we can use this property to access the `iframe` elements on a page.

To access each element in this array like object, we can use the same syntax that we used for arrays!

For example, this is the way to get the first element of such an object (let’s say the name of the object is “frames”):


This is the same as if we’ve used the “getElementsByTagName()” method.

For example:


Window frames Property Syntax:


Example: using JavaScript Window frames Property

See the Pen using JavaScript Window frames Prope by Omid Dehghan (@odchan1) on CodePen.


Top Technologies