Computer >> Computer tutorials >  >> Programming >> Javascript

How to load an HTML file into the canvas?


For this, you can use the SVG <foreignObject> elements. Let us see an example:

<svg xmlns = "https://www.w3.org/2000/svg">
<foreignObject x = "0" y = "0" height = "500" width = "500">
   <body xmlns = "https://www.w3.org/1999/xhtml">
      <p>DEMO</p>
      <input type = "date"/>
   </body>
</foreignObject>
</svg>