I want to have a text and right of it to have a image (arrow up or down). I used this code:
<div id="more-time1" class="small-text-size ">more time<span id="arr-icon" class="accordion_down"></span></div>
The external div holds the text and the internal span has the image (the image is data in the class). When I change the text of the div:
var moreTime = document.getElementById("more-time1");
moreTime.innerHTML = "less time";
It delete span and I can't change the image in it unless I add every time a new span to it.
My question is: Do I need to add span every time or I can have a better design which change text won't affect the span? Or maybe other solution?