Rank: Advanced Member Groups: Member
Joined: 4/2/2014 Posts: 37
|
Hi,
I am replacing System.Windows.Forms.WebBrowser with EO.WebBrowser.WinForm.WebControl. In my project, I need to first render a page. After navigation is completed, I need to programmatically modify the html content and then see the changes on the browser control immediately. For example, I need to change style or classname attributes on a tag. I tried something like this:
browserCtrl.WebView.GetDOMWindow().document.getElementById("id").className = "myclass"
But classname is read-only, so I can't do this.
Also, I have no idea how to change style attribute or outerHTML.
Any help will be greatly appreciate
Thanks Howie
|
Rank: Administration Groups: Administration
Joined: 5/27/2007 Posts: 24,196
|
Hi, You can do something like this:
Code: C#
browserCtrl.WebView.EvalScript("document.getElementById('id').className='css_class_name';");
Thanks!
|