0
How to replace string to node
I want to replace string to node. paragraph = document.getElementById('paragraph ') word = document.getElementById('word') val = paragraph.childNodes[0].nodeValue paragraph.innerHTML = val.replace(/text\s/, word) something like this.
1 Resposta
0
Если правильно понял то это как то вроде так:
paragraph.innerHTML = '';
paragraph.append(word);