Can the image source be changed using a JavaScript variable? For example, if I have a variable called "vp_active_row_count" that indicates which ball is active by number ("_a" signifies active image source).
I am struggling to locate any object with the provided JavaScript code. Is it actually feasible?
Javascript
var vp_active_row_count=2;
var test = '"#'+vp_active_row_count+'"';
$(test).attr('src','assets/img/vp_a.png');
HTML
<div class="vp_balls" style="width: 48px;">
<img id="1" src="assets/img/vp_a.png">
<img id="2" src="assets/img/vp.png">
<img id="3" src="assets/img/vp.png">
</div>