Article Categories
- All Categories
-
Data Structure
-
Networking
-
RDBMS
-
Operating System
-
Java
-
MS Excel
-
iOS
-
HTML
-
CSS
-
Android
-
Python
-
C Programming
-
C++
-
C#
-
MongoDB
-
MySQL
-
Javascript
-
PHP
Selected Reading
Alternatives to HTML5 iframe srcdoc?
The HTML <iframe> tag is used to create an inline frame.
Example
<!DOCTYPE html> <html> <head> <title>HTML iframe Tag</title> </head> <body> <iframe src = "https://www.tutorialspoint.com/index.htm" width = "100%"></iframe> </body> </html>
The srcdoc attribute specifies the HTML content of the page to show in the iframe
An alternative of the srcdoc attribute will be −
var doc = document.querySelector('#demo').contentWindow.document;
var content = '<html></html>';
doc.open('text/html', 'replace');
doc.write(content);
doc.close(); Advertisements
