I have the following HTML
<div class="card-text" data-test-info-type="price">
<div class="price-section price-section--withoutTax ">
<span data-product-price-without-tax="" class="price price--withoutTax">$20.00</span>
</div>
</div>
I'm trying to append the following text to the $20.00 Prices include taxes
So the end result would be $20.00 Prices include taxes
However I'm hitting a brick wall trying to achieve this I have tried the following:
var span = document.getElementsByClassName("price price--withoutTax");
var txt = document.createTextNode("Prices include taxes");
span.innerText = txt.textContent;
Yet it remained as $20.00
I then tried
document.getElementsByClassName('price price--withoutTax').innerHTML = "hello";
Again same result stayed as $20.00
Can someone shed some light on how I go about appending additional text to a span tag?