Is the javascript important for you? That text won't be recognised by search engines. I suggest you to use css for that purpose.
Set the image into a div as background with the following css code.. For instance: <div class="img"><p class="t">text on the image</p></div> .img{ width:100px; (same as the image width) height:50px; (same as the image height) } t.{ margin:auto;}
thank reply to me i want write text is dymamic by java cript ex: i have textbox and have some text When i click on the image this text will view on this position so clicked mouse
That, or you could define a div to use the image as background, then you can add your text "above" the image easily.