I am adding some javascript code to a script tag programmatically by assigning it to InnerHtml property of the HtmlNode
scriptNode.InnerHtml =new_script;
and my javascript contains less than < and/or greater than > characters and that causes problems - distorts my resulting javascript. How can I escape those.
Here is a sample javascript that is causing the problem:
function myFunc(el){
var i=0
for (;i < el.choice.length;i++){
....
}
}
How can I escape the < in the code above while assigning the code as InnerHtml for my Html node?