0

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?

2
  • how to convert what? what are trying to achieve? Commented Apr 20, 2012 at 13:22
  • @Elen convert that text. I think it has to be an image first, because once it be came an image, I want to add class and with other images i will capture it in php. Commented Apr 20, 2012 at 13:29

1 Answer 1

2

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.

Sign up to request clarification or add additional context in comments.

1 Comment

Show some effort. Read the docs. Try writing some of your own code, and come back when you have a specific problem with a particular step. Stack Overflow is not a Code Writing, Tutorial or Consulting Service.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.