I have researched this and it seems it is complicated or at least not simple to use a variable declared in JavaScript in an HTML document multiple times.
For instance, I have multiple (hundreds) of div's with IMG statements referencing different JPG files. I want to give a path to those files that is the same on each div, and I want to be able to declare the path text in a variable and use it on each line. This would give me the ability to change the path by just changing the variable. The fact that I would be using it multiple times means that "id=" would not work since it can only be used once.
It is a shame there is not a simple way to do this, as I am sure it would be very useful. An example using an IMG in a DIV would be helpful.
Example:
<div class="column">
<img src="SomePathtoFile/images/1.jpg" class="myimages"
onclick="openModal();currentSlide(1)" class="hover-shadow cursor">
</div>
I want the "SomePathtoFile" to be a variable used in this and all following div's.