<div class="here_is_div">
<label class="a_label">
<input type="checkbox" name="checkbox">
Hello world
</label>
</div>
I thought textContent would be able to just change the TEXT
document.getElementsByTagName('label')[0].textContent = "Hello World is replaced"
However, textContent replaces everything including checkbox. Is there a better way to just change text without doing something like below:
document.getElementsByTagName('label')[0].innerHTML = '<input type="checkbox" name="checkbox">Hello world is replaced';
textNodechild of the label and change it.