Is there any way for me to disable all sort of JavaScript inside a particular div?
I initially thought the <noscript> tag was meant for that, but it turns out I was wrong.
Here is what I am looking for:
<some-sort-of-tag-here>
<script>
alert('test');
</script>
</some-sort-of-tag-here>
Would get rendered as:
<script>
alert('test');
</script>
Rather than executing the script. This would prevent any form of XSS and other external JavaScript (that has been included in the head) would be able to modify the given tag.
I may be completely wrong here and such a tag may not exist at all, but please help me out here. I feel such a tag would be the simplest solution to XSS. There's no need to worry about any script executing inside the tag, (which means all user content can be wrapped in that tag), while all website-included javascript would be able to modify the content of the page as required.
How would I proceed with creating a tag inside which all content is treated as pure HTML only and not execute any form of JavaScript inside it?