<body>
<p >text</p>
<script type="text/javascript">
let element = document.querySelectorAll("p");
element.innerHTMl="new text";
</script>
</body>
let element = document.querySelectorAll("p")[0];
element.innerHTML="new text";
element[0].innerHTMl="new text";