const p = document.querySelectorAll("p"); console.log(p[1].innerHTML); /*second*/ <p>first</p> <p>second</p> <p>third</p> <p>fourth</p>