Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

175
Views
Trying to create an image with HTML and jQuery

I'm trying to do a transformation about html to base64, but its not working. Can someone help me? On the first code is on a tag, this code try to make get the form values to transfer to the h3 id="testando" so I can change color, background and trying to put Font Awesome on my h3, later of this I'm trying to make my html convert to canvas and canvas convert to base64, but its not working

$(document).ready(function() {
  $("#enviar").click(function() {
    var unicode = $('#uunicode').val();
    var fonte = "Font Awesome 5 Free";
    var cor = $('#ccor').val();
    var tamanho = $('#ctamanho').val();
    $("#testando").css("color", cor);
    $("#testando").css("font-size", tamanho);
    
    html2canvas(document.getElementById("testando"), {
      allowTaint: true,
      useCORS: true
    }).then(function(canvas) {
      var anchorTag = document.createElement("a");
      document.body.appendChild(anchorTag);
      base64 = anchorTag.href = canvas.toDataURL();
      alert(base64);
    });
  });
});
   ​<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.3.1/jquery.min.js"></script>
   ​<script src="https://cdnjs.cloudflare.com/ajax/libs/html2canvas/1.3.2/html2canvas.min.js" integrity="sha512-tVYBzEItJit9HXaWTPo8vveXlkK62LbA+wez9IgzjTmFNLMBO1BEYladBw2wnM3YURZSMUyhayPCoLtjGh84NQ==" crossorigin="anonymous" referrerpolicy="no-referrer"></script>

   ​<p>
 ​<h3 id="testando"></h3>
   ​</p>

about 4 years ago · Juan Pablo Isaza
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!