Skip to content
RED SAG Skills
easy5 pts · first answer countsweb-securityxss

Writing location.hash into the page

This code shows a welcome name taken from the URL fragment. What is the problem?

const name = decodeURIComponent(location.hash.slice(1))
document.getElementById('hi').innerHTML = 'Hello ' + name
Choose one answer

Discussion 0

Join free to post in the discussion.

Related questions