I have a javascript variable that I want to include it in my html code. The code is like this:
<a href="index.html"><img src="Images/Icones/Mes_commandes.png" alt="France" id="im1">MY_JS_VARIABLE</a></li>
How can I do?
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
If you use the after() function proposed in dldnh’s solution, then it’ll be hard to keep your code organized as you want javascript to do more on your page (you’ll have to add everything in the after function since Javascript can only have one onload event handler).
If you plan to use more javascript on the page, a better option would be to use jQuery. Like so: