Javascript select nested class element

document.querySelectorAll('.cl1 .sl_price');

This will select all nested sl_price elements inside cl1. If you are looking to modify more cl's (i.e. cl1, cl2, cl3) just add a common class to all of them such as cl.


getElementsByClassName returns a collection (list) of elements (will therefore not have a innerHTML property)

You could try document.querySelector(".cl1 .sl_price") instead (takes a css selector and returns the first match)

read more at https://developer.mozilla.org/en-US/docs/Web/API/Document.querySelector

The end result would then be something like this;

document.querySelector('.cl1 .sl_price').innerHTML = "from only £00.00<br>";

Note: I am assuming you only wanted to match a single element. If not, you should look at @Bommox's answer and querySelectorAll.