add something to textarea

G

Gordan

Hi.

i have a text area and would like to add some text to it when i click a
button so I put this code:
var txtarea = document.form.text;
txtarea.focus();
txtarea.value+="some text";

the problem is that this adds "some text" on the end of the text in my text
area
I want the "some text" after my cursor position

could you help me do that :)

thanks, Gordan
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,769
Messages
2,569,579
Members
45,053
Latest member
BrodieSola

Latest Threads

Top