How to specify the HTML content of the page to show in the <iframe> in HTML?

HTMLWeb DevelopmentFront End Technology

Use the srcdoc attribute to specify the HTML content of the page to show in the <frame>. You can try to run the following code to implement srcdoc attribute −

Example

<!DOCTYPE html>
<html>
   <body>
      <iframe srcdoc = "<h2>Tutorialspoint</h2>" src = "new.html">
         <p>Browser do not support iframes.</p>
      </iframe>
   </body>
</html>
raja
Published on 14-Mar-2018 15:34:12
Advertisements