powered by simpleCommunicator - 2.0.61     © 2026 Programmizd 02
Целевая тема:
Создать новую тему:
Автор:
Закрыть
Цитировать
Форумы / HTML, JavaScript, VBScript, CSS [игнор отключен] [закрыт для гостей] / (JS) Node cannot be inserted at the specified point in the hierarchy
3 сообщений из 3, страница 1 из 1
(JS) Node cannot be inserted at the specified point in the hierarchy
    #36230295
Всего-то делов:
Код: plaintext
1.
2.
newElement = document.createElement('textarea');
newElement.name = newElement.id = 'el_01';
document.appendChild( newElement );
Почему ругается (см. сабдж)?

Если пишу:
Код: plaintext
1.
in_div = doсument.getElementById('div01');
in_div.appendChild( newElement );
всё нормально работает...
...
Рейтинг: 0 / 0
(JS) Node cannot be inserted at the specified point in the hierarchy
    #36230304
Фотография Яростный Меч
Скрыть профиль Поместить в игнор-лист Сообщения автора в теме
Участник
Дмитрий-(сколько-же-нас?)
Код: plaintext
document.appendChild( newElement );
Наверно, непонятно, куда добавлять.
Может, в body?
Код: plaintext
document.body.appendChild( newElement );
...
Рейтинг: 0 / 0
(JS) Node cannot be inserted at the specified point in the hierarchy
    #36230309
Яростный Меч,

Спасибо!

В body заработало.
Странно, но до этого (в предыдущем коде) стояло без body и работало!
...
Рейтинг: 0 / 0
3 сообщений из 3, страница 1 из 1
Форумы / HTML, JavaScript, VBScript, CSS [игнор отключен] [закрыт для гостей] / (JS) Node cannot be inserted at the specified point in the hierarchy
Найденые пользователи ...
Разблокировать пользователей ...
Читали форум (0):
Пользователи онлайн (0):
x
x
Закрыть


Просмотр
0 / 0
Close
Debug Console [Select Text]