+ 1

Code not working

<!DOCTYPE html> <html> <head> <title>Page Title</title> </head> <body> <script> let username="satveek"; let items =5; let text= 'hello ${username } you have ${items} items in your cart' console.log(text); </script> </body> </html>

17th Oct 2023, 4:13 AM
Satveek Prakash
Satveek Prakash - avatar
2 Answers
+ 6
Where you declared text you need to use back ticks like this `` for it to run
17th Oct 2023, 4:34 AM
Aweneg Rooney
Aweneg Rooney - avatar
+ 1
Bro you should write script tag with indentation and main problem is that you should write let text; text= `hello ${surname} you have ${items} in your cart`;
17th Oct 2023, 5:58 PM
ADITYA MISHRA
ADITYA MISHRA - avatar