RemoveAllChildren

public void RemoveAll()

Removes all the children of the current node. RemoveAllChildren method is a member of HtmlAgilityPack.HtmlNode

Examples

The following example removes all the children of the current node.

var htmlDoc = new HtmlDocument();

htmlDoc.LoadHtml(html);

var htmlBody = htmlDoc.DocumentNode.SelectSingleNode("//body");

htmlBody.RemoveAllChildren();

Click here to run this example.