I was just wondering if there was a way to dynamically add a text?
You can add an image like this:
var img1 = new Image(); // DOM 0
img1.src = 'image1.png';
img1.alt = 'alt';
document.body.appendChild(img1);
Would you do –V– ??
var Txt = new Text();
Thanks!
EDIT:
I how would I move this text??
Thanks!
I don’t really understand what do you mean, to attach a text element you just need to create a text node with
and then attach it to the body or wathever div you want.
Edit
Esailija already gave you the right answer.