var a = 20;
document.getElementById("result").innerHTML = "Your variable is ${a}";
Asked
Active
Viewed 18 times
0

Felix Kling
- 795,719
- 175
- 1,089
- 1,143

Jad Amine
- 1
- 1
-
you need to be using template literals (backticks) not quotes – AnanthDev Feb 17 '22 at 09:50
-
change your string to `\`Your variable is ${a}\`` – KreutzerCode Feb 17 '22 at 09:51
-
Thank you so much guys, wish you good luck and a healthy environment @AnanthDev, – Jad Amine Feb 17 '22 at 10:13
-
and @KreuterCode – Jad Amine Feb 17 '22 at 10:13