change html text by javascript class name in hierarchy
Example <!DOCTYPE html> <html> <body> <h1>The Document Object</h1> <h2>The querySelectorAll() Method</h2> <p>Add a background color all elements with class=”example”:</p> <h2 class=”example”>A heading</h2> <div class=”asdf”><p class=”example”>A paragraph.</p> </div> <script> const tinaicon = document.querySelectorAll(“.asdf .example”); for (let i = 0; i < tinaicon.length; i++) { tinaicon[i].innerHTML = “your text here”; } </script> </body> </html> output Browser Support […]
change html text by javascript class name in hierarchy Read More »