Alternatives To HTML5 Iframe Srcdoc? - Tutorialspoint

  • Home
  • Whiteboard
  • Online Compilers
  • Practice
  • Articles
  • AI Assistant
  • Jobs
  • Tools
  • Corporate Training
  • Courses
  • Certifications
Menu Categories Login
  • Switch theme
  • SQL
  • HTML
  • CSS
  • Javascript
  • Python
  • Java
  • C
  • C++
  • PHP
  • Scala
  • C#
  • Tailwind CSS
  • Node.js
  • MySQL
  • MongoDB
  • PL/SQL
  • Swift
  • Bootstrap
  • R
  • Machine Learning
  • Blockchain
  • Angular
  • React Native
  • Computer Fundamentals
  • Compiler Design
  • Operating System
  • Data Structure and Algorithms
  • Computer Network
  • DBMS
  • Excel
Technical Questions and Answers
  • Data Structure Data Structure
  • Networking Networking
  • RDBMS RDBMS
  • Operating System Operating System
  • Java Java
  • MS Excel MS Excel
  • iOS iOS
  • HTML HTML
  • CSS CSS
  • Android Android
  • Python Python
  • C Programming C Programming
  • C++ C++
  • C# C#
  • MongoDB MongoDB
  • MySQL MySQL
  • Javascript Javascript
  • PHP 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
Alternatives to HTML5 iframe srcdoc? JavascriptWeb DevelopmentFront End Scripts

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(); George John George John Updated on: 2020-06-25T07:44:29+05:30

597 Views

Kickstart Your Career

Get certified by completing the course

Get Started Print Page Previous Next Advertisements

Từ khóa » Html5 Alternative To Iframe