C# – How to remove an HTML element programatically from web browser control

cwebbrowser-control

I use a web browser control and the document is loaded with an HTML page. I want to remove an element programmatically form the document.

Can any one guide me how can I remove any element by ID or name attribute?

Best Answer

webbrowser.Document.GetElementById("element").OuterHtml = "";