0

As you may have noticed, you can't use this property for any element you created yourself.
Here's a workaround:

string sId = "Id of the element you want to change the property of";
string sInnerHtml = "The new InnerHtml string you want to set";

string sScript = @"
var oElem = document.getElementById('" + sId + @"');
if (oElem) {
  oElem.innerHTML = '" + sValue + @"'
}"

myWebBrowser.Document.InvokeScript("execScript", new Object[] { sScript, "JavaScript" });
2
Contributors
2
Replies
3
Views
5 Years
Discussion Span
Last Post by thines01
0

Sorry, forgot to write, which classes I was writing about.

myWebBrowser is an instance of System.Windows.Forms.WebBrowser

This question has already been answered. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.