7 / 100

how can i use this code with wordPress website

<!DOCTYPE html>
<html>
  <head>
    <title>Text to Image Generator</title>
    <style>
      #canvas {
        border: 1px solid black;
      }
    </style>
  </head>
  <body>
    <div>
      <label for="text-input">Enter Text:</label>
      <input type="text" id="text-input" />
      <button onclick="drawText()">Generate Image</button>
    </div>
    <canvas id="canvas"></canvas>
    <script>
      function drawText() {
        var canvas = document.getElementById("canvas");
        var ctx = canvas.getContext("2d");
        var text = document.getElementById("text-input").value;
        ctx.font = "30px Arial";
        ctx.fillText(text, 10, 50);
      }
    </script>
  </body>
</html>
Text to Image Generator
Text to Random Image Generator
Text to Image Generator

Leave a Comment