javascript - How do I use variables in my href when downloading a file? -


javascript

i have 3 variables use define href downloading file:

var fselect; var uselect; var bselect; 

so href defined variable this:

var savefile = '../files/' + fselect + uselect + bselect + '.x3g'; 

html

but how use in html document?

<a><img src="../save-button.png" alt="save" width="120" height="40" /></a> 

give img tag id attribute (in case, i'm using img)
modify tag using dom

document.getelementbyid("img").src = savefile;


Comments

Popular posts from this blog

javascript - Google App Script ContentService downloadAsFile not working -

javascript - Function overwritting -

php - Find a regex to take part of Email -