

- Trending Categories
Data Structure
Networking
RDBMS
Operating System
Java
iOS
HTML
CSS
Android
Python
C Programming
C++
C#
MongoDB
MySQL
Javascript
PHP
- Selected Reading
- UPSC IAS Exams Notes
- Developer's Best Practices
- Questions and Answers
- Effective Resume Writing
- HR Interview Questions
- Computer Glossary
- Who is Who
Setting full screen iframe in JavaScript?
Following is the code for setting full screen iframe in JavaScript −
Example
<!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8" /> <meta name="viewport" content="width=device-width, initial-scale=1.0" /> <title>Document</title> <style> body { font-family: "Segoe UI", Tahoma, Geneva, Verdana, sans-serif; } .result { font-weight: 500; font-size: 18px; color: blueviolet; } .fullScreen { width: 100vw; height: 100vh; } </style> </head> <body> <h1>Setting full screen iframe</h1> <iframe class="frame" src="https://www.wikipedia.com" width="300px" height="200px" ></iframe> <button class="Btn" style="margin: 15px;">Fullscreen</button> <h3>Click on the above button to make the iframe go fullscreen</h3> <script> let BtnEle = document.querySelector(".Btn"); let frameEle = document.querySelector(".frame"); BtnEle.addEventListener("click", () => { frameEle.className = "fullScreen"; }); </script> </body> </html>
Output
On clicking the ‘Fullscreen’ button −
- Related Questions & Answers
- Creating Tkinter full-screen application
- How to get full screen activity in android?
- How to create a full screen search box with CSS and JavaScript?
- How to display full-screen mode on Tkinter?
- How to make full screen custom dialog in Android?
- How to Handle CSS in Browser Full-Screen Mode?
- How to create a full screen overlay navigation menu with CSS and JavaScript?
- How to create a full screen video background with CSS?
- How to set dialog to show with full screen in Android?
- Setting object members in JavaScript
- Is an empty iframe src valid in JavaScript?
- JavaScript JavaScript BOM Window Screen
- How to set dialog to show with full screen in Android using Kotlin?
- HTML5 video full preload in JavaScript
- Determining full house in poker - JavaScript
Advertisements