Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Update text on image in html

I have used em tags to write some text on an image. I want to provide some kind of functionality such that when a user types in text box this text comes over image. I have doubt which event listener should I add to text box so that as soon as change the content of text box it can change the content of image too. I just need to know can this be done with event listener or something more is needed. I know how to change text in image but could not find out how should i update this image text dynamically. Hope am clear with question

like image 381
Sachin Avatar asked Dec 13 '25 16:12

Sachin


1 Answers

Here is another alternative way to use pure javascript.

Add onkeyup in textbox and call a function that you have provided.

<input type="text" id="tbMain" onkeyup="keyup();">

When press the key up its will call function keyup()

See more at here.

like image 102
OammieR Avatar answered Dec 15 '25 08:12

OammieR