Can anyone please help me with this solving this code in Javasript Quiz Project | Sololearn: Learn to code for FREE!

0

Can anyone please help me with this solving this code in Javasript Quiz Project

https://code.sololearn.com/WA17a119A14A this is my code error occurs in last part in javscript

7/17/2021 11:42:10 AM

अभि

3 Answers

New Answer

+2

You forgot the backticks, `<h3> you scored ${score}/${quizDB.length} ✌</h3> <button class="btn" onclick="location.reload()">play again</button>`

+1

You cannot put HTML tags like that in Javascript. For line 102, you need to put the html tag in quotes to make it a string. When you do that, another error on line 103 appears, because again, you can't put HTML tags in JS, you need to get the element you want to insert the tag into, using document.getElementById or other functions, and then use the createElement and appendChild functions.

+1

inxanedev! You can assign the html that way without using createElement . All you need is to assign that html string to innerHTML property instead of textContent .