Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

Select All Elements With A Class getElementsByClassName


  const p =  document.getElementByClassName("bar");
   console.log(p[1].innerHTML);

 <p class="bar">first</p>

 <p class="bar">second</p>


 <p class="bar">third</p>

 <p class="bar">fourth</p>
 
PREVIOUS NEXT
Tagged: #Select #All #Elements #With #A #Class #getElementsByClassName
ADD COMMENT
Topic
Name
1+6 =