How to resolve < script > in < script type= "text/template" >. < / script >?

<script id="tpl" type="text/template">
<script>alert(1)</script>
</script>
<script>
console.log($("-sharptpl").html());
</script>

output : < script > alert (1)
how to solve this problem without ending < / script > ?

Mar.08,2021

looks like < script > of -sharptpl and < / script > after alert (1) , so the output is missing the ending < / script > .
and, from elements, you can clearly see that < / script > in the third line is ignored.

script nested script is useless, the browser does not recognize it correctly, and even if the browser does, it will not work.

for this question, please see the link , which is similar to yours.

MySQL Query : SELECT * FROM `codeshelper`.`v9_news` WHERE status=99 AND catid='6' ORDER BY rand() LIMIT 5
MySQL Error : Disk full (/tmp/#sql-temptable-64f5-1b3b42b-2afc1.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
MySQL Errno : 1021
Message : Disk full (/tmp/#sql-temptable-64f5-1b3b42b-2afc1.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
Need Help?