Computer >> Hướng Dẫn Máy Tính >  >> Lập Trình >> JavaScript

Cách tải file HTML vào canvas

Để làm điều này, bạn có thể dùng phần tử SVG <foreignObject>. Xem ví dụ:

<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>