I am looking for an ideal way to display a URL exactly as it is in HTML using vanillaJS.
http://x.com/index.php?file\=Test&op\="><script>window.alert('test');</script>
I tried <xmp>
tag that works but it is an obsolete tag.
Can someone help with a way to stringify the URL to display as it is.
This is different from the other question as it needs to prevent XSS and show the URL exactly as given.
` makes no sense, whitespace doesn't have any significance so `
– Quentin Aug 08 '17 at 19:13