I have a div with id=content, and I want to change it's innerHtml to a string variable markup, but I want to disable script tags.
For example, if
markup='<b>Bold text here </b><i><script>alert("JS will be treated as normal text")</script></i>';
The content div should be
Bold text here <script>alert("JS will be treated as normal text")</script>
I can't use innerHTML since it'll run the alert box,and I can't use innerText because the other tags will be displayed as normal text.
I searched for this problem and found a lot of regix expressions.I don't know a lot about regix, but all of the expressions I found were to remove all tags, not to disable a tag.
I don't want to use jquery ,even though I tried to use .vla() and .text() and didn't work. But now I want to use js only.
I also want it to be able to handle any valid variation of the script tag, including: <Script>, <sCrIPt>, <script type= "text/javascript">, and </script >