[Solved] getElementsByTagName() – Only want select elements, not all


This will work.

function Change() {
var a = document.getElementsByTagName("ul")[0];
a.getElementsByTagName("li")[0].innerHTML = "2";
}
<ul>
<li>1</li>
<li>3</li>
</ul>
<button onclick="Change();">Change</button>

1

solved getElementsByTagName() – Only want select elements, not all