Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

how to select a class and then change the children of that class with javascript

//First store your class inside a variable and then select it with query selector
var x = document.querySelectorAll('.location-address');
x[0].innerHTML += '<br><a href="https://www.yahoo.com">';
x[1].innerHTML += '<br><a href="https://www.google.com">';
x[2].innerHTML += '<br><a href="https://www.microsoft.com">';
 
PREVIOUS NEXT
Tagged: #select #class #change #children #class #javascript
ADD COMMENT
Topic
Name
7+1 =