I am working on changing some of the slider elements on my website.
my slider code is as follows:
<div class="cl1"> <h1>Some heading</h1> <div class="sl_descr">Some description</div> <div class="sl_price">from only β¬00.00<br></div> </div> <div class="cl2"> <h1>Some other heading</h1> <div class="sl_descr">Some other description</div> <div class="sl_price">from only β¬00.00<br></div> </div> <div class="cl3"> <h1>yet some heading</h1> <div class="sl_descr">yet Some description</div> <div class="sl_price">from only β¬00.00<br></div> </div>
I want to change the price when the currency changes. For this, I would like to use javascript with getElementsByClassName and then innerHTML. However, my javascript does not work the way you wanted. Here
document.getElementsByClassName('cl1 sl_price').innerHTML="from only Β£00.00<br>";
Any suggestions on how I can separately specify the class "sl_price" for each element "cl"? Greetings
source share