title: How to inject Javascript in WebBrowser control
body: <p>There is a great tutorial here about windows forms</p>
  
  <p><a href="https://stackoverflow.com/questions/153748/how-to-inject-javascript-in-webbrowser-control">How to inject Javascript in WebBrowser control?</a></p>
  
  <p>I tried it and it works great</p>
  
  <p>But the problem is the objects used there is not recognized at wpf application. So what i am asking is what is the equivalent of the function below in wpf application. Thank you.</p>
  
  <pre><code>HtmlElement head = webBrowser1.Document.GetElementsByTagName("head")[0];
  HtmlElement scriptEl = webBrowser1.Document.CreateElement("script");
  IHTMLScriptElement element = (IHTMLScriptElement)scriptEl.DomElement;
  string srJquery = File.ReadAllText("jquery.txt");
  element.text = srJquery;
  head.AppendChild(scriptEl);  
  </code></pre>
  
  <p>the function above is working perfectly at windows form application c# 4.0 but the used objects such as HtmlElement is not recognized at WPF application.</p>