What have you tried? Hint: You want it to update as you type, so try and find an event on the TextBox you can utilise to run the function you provided above.
–
WidorMay 25 '12 at 15:49

well I have tried : <input type="text" id="testing"/>...and then to get the value : oCtx.fillText(document.getElementById('example_text').value, 283,350);...But it's not working, nothing happens
–
pipomenaceMay 25 '12 at 15:55

1

@user1388136 - that's because you need an event to trigger the update of your canvas element. You're probably going to need the onblur or onchange event.
–
j08691May 25 '12 at 15:56

Ok. And how can I make this work using onBlur event? So when I would type, it would update the variable? I'm not sure...Thanks!
–
pipomenaceMay 25 '12 at 15:58

Note that you could use the change event instead of the keydown event, but change will only fire after the user moves focus away from the textbox. The keypress event will work similarly to keydown, but it won't catch backspaces.