Kobjir
Kobjir

Reputation: 1

jquery input text convert to image

I have this input text code:

$("#text1").keyup(function() {
    $('#text2').text($('#text1').val());
});
$('#text2').draggable({
    containment: 'parent'
});

Question: how to convert it to image in jquery?

Upvotes: 0

Views: 854

Answers (1)

Matt Ball
Matt Ball

Reputation: 359966

If I understand the question correctly, you want to convert a piece of text to an image.

Use a <canvas> tag to render text, and then call toDataURL() to get a base64 representation of the image data.

Upvotes: 2

Related Questions