Добавьте текст к текстовой области с помощью JavaScript

DECLARE @date DateTime
SET @date = GetDate()
SET @date = DateAdd(day, 1, @date)

SELECT @date
7
задан demongolem 21 June 2011 в 18:36
поделиться

3 ответа

function addText(elId,text) {
    document.getElementById(elId).value += text;
}

или:

function addText(elId,text) {
    var obj = document.getElementById(elId);
    var txt = document.createTextNode(text);
    obj.appendChild(txt);
}
17
ответ дан 6 December 2019 в 10:01
поделиться
myTextarea.value += "text to add to the textarea"
2
ответ дан 6 December 2019 в 10:01
поделиться

Grab the existing text in the textarea (the element's .value)

Combine your existing text (append, prepend, insert, or whatever you need)

Write the result back to the textarea.

Tah-dah!

0
ответ дан 6 December 2019 в 10:01
поделиться
Другие вопросы по тегам:

Похожие вопросы: