Okay, so here is the thing, i made a site in which you can change it into two different languages (spanish an english) and i have a button that everytime you click on it, redirects you to a pdf file which its in spanish but what should happen its that when the text on the button changes to english the file also changes to the file in english
Here its the button
<div data-aos="fade-up" data-aos-delay="800" class="text-center">
<a href="assets/img/File1.pdf" class="btn-get-started scrollto">Ver CV</a>
</div>
So the idea its that the href of the changes its value for the second file (which would be in english), i tried with only Javascript and also with JQuery, what i expect its that whenever the site its on english when clicking the button they’ll see the file in English and when the button would be in spanish they’ll see the file in spanish
<div data-aos="fade-up" data-aos-delay="800" class="text-center">
<a href="assets/img/File2.pdf" class="btn-get-started scrollto">Ver CV</a>
</div>
2
Answers
Okay, if I understand right… It’s a basic JS solution.
Here’s the HTML
Here’s the JS
Inject updateCV 👆 inside the other button/function that request the language-change.
If by changing language the website is refreshed you could use a server-side variable to define the link like i.e in PHP template:
Otherwise,
however you change the website’s language (not clear from your question) you should also change
into
and given you have this HTML:
than it’s all about CSS: