C# HtmlElement JavaScript won't set InnerHtml
<p>I made HtmlElement instance using the tag 'script' and it wont allow me to set the InnerHtml member. </p>

<p>Why is that?</p>

<pre><code>HtmlElement tempElement = wbMain.Document.CreateElement("script");

wbMain.Document.GetElementsByTagName("head")[0].AppendChild(tempElement);

tempElement.SetAttribute("type", "text/javascript");
tempElement.InnerHtml = "function test(a){document.getElementById('test').value = a;}";
</code></pre>

<p>The end goal of this is to inject JavaScript code into a webpage and execute it from the application using the InvokeScript function in the webbrowser form's htmldocument</p>
