I need to get the id's of all products that are in divs with the same class. My code is only giving me the first product's id.
Here is the html code
<td>
<div class="b-sku">SKU: 123456</div>
</td>
<td>
<div class="b-sku">SKU: 33333</div>
</td>
I created this javascript code to just fetch value
function (){
var out0 = document.querySelector('.b-sku').textContent;
var out1 = out0.replace(/SKU:/g, "");
var out2 = out1.replace(/\s/g, '');
return out2;
}
But this code is only returning 123456 and not 33333
I would like to get both the ids in comma separated format like
['123456', '33333']
Please advise.
out0NodeList