I have a div with some text and a child div. I want to update the outer div text and keep the child div.
<div class="outer">
some text here
<div class="arrow-down"></div>
</div>
if I try outer.innerText = "foo"
the arrow-down element is deleted. How can I get around this?
Thanks
span
element as the first child of the outer div, assign an ID to it and target that span element when updating the text. – Archibaldo