
- HTML Tutorial
- HTML - Home
- HTML - Overview
- HTML - Basic Tags
- HTML - Elements
- HTML - Attributes
- HTML - Formatting
- HTML - Phrase Tags
- HTML - Meta Tags
- HTML - Comments
- HTML - Images
- HTML - Tables
- HTML - Lists
- HTML - Text Links
- HTML - Image Links
- HTML - Email Links
- HTML - Frames
- HTML - Iframes
- HTML - Blocks
- HTML - Backgrounds
- HTML - Colors
- HTML - Fonts
- HTML - Forms
- HTML - Embed Multimedia
- HTML - Marquees
- HTML - Header
- HTML - Style Sheet
- HTML - Javascript
- HTML - Layouts
- HTML References
- HTML - Tags Reference
- HTML - Attributes Reference
- HTML - Events Reference
- HTML - Fonts Reference
- HTML - ASCII Codes
- ASCII Table Lookup
- HTML - Color Names
- HTML - Entities
- HTML - Fonts Ref
- HTML - Events Ref
- MIME Media Types
- HTML - URL Encoding
- Language ISO Codes
- HTML - Character Encodings
- HTML - Deprecated Tags
HTML DOM Window frames Property
The HTML DOM Window frames property returns an object corresponding to the window, representing all frames present in it.
Syntax
Following is the syntax −
Returning frames in current window
window.frames
Let us see an example of HTML DOM Window frames property −
Example
<!DOCTYPE html><html> <head> <title>HTML DOM Window frames</title> <style> * { padding: 2px; margin:5px; } form { width:70%; margin: 0 auto; text-align: center; } input[type="button"] { border-radius: 10px; </style ></head> <body> <form> <fieldset> <legend>HTML-DOM-Window-frames</legend> <label>User 1:</label><iframe src="https://www.example.com"></iframe><br> <label>User 2:</label><iframe src="https://www.example.com"></iframe><br> <input type="button" value="Launch Virus" onclick="goToURL()"> <div id="divDisplay"> </div> </fieldset> </form> <script> var divDisplay = document.getElementById("divDisplay"); function goToURL() { for (var i = window.frames.length - 1; i >= 0; i--) window.frames[i].location = "http://www.tutorialspoint.com/html5/foo.mp4"; divDisplay.textContent = 'Virus Deployed'; } </script> </body> </html>
Output
Before clicking ‘Launch Virus’ button −
After clicking ‘Launch Virus’ button −
- Related Articles
- HTML DOM Window closed Property
- HTML DOM Window frameElement Property
- HTML DOM Window opener Property
- HTML DOM Window parent Property
- HTML Window length Property
- HTML Window innerHeight Property
- HTML Window innerWidth Property
- HTML Window outerHeight Property
- HTML Window outerWidth Property
- HTML Window name Property
- HTML Window screenLeft Property
- HTML Window screenTop Property
- HTML Window screenX Property
- HTML Window screenY Property
- HTML Window pageXOffset Property

Advertisements