i have a simple html code
i use this code
So, how do i can change the innerText of <p>.
Thanks for read!
<p style="background-color:#FFFFFF;" align="center">CHAPTER XIII</p>
<p style="background-color:#FFFFFF;" align="center"><span class"font0">AUSTRALIAN AIRMEN IN FRANCE</span></p>
i want to remove all childnode in <p> tag and keep innerText of <p> as plaint texti use this code
foreach (HtmlNode note in doc.DocumentNode.SelectNodes("//p"))
{
string innerText = string.Empty;
foreach (HtmlNode childnode in note.ChildNodes)
{
innerText += childnode.InnerText;
note.RemoveAllChildren();
note.InnerText = innerText;
}
try
{
note.Attributes["style"].Remove();
note.Attributes["align"].Remove();
}
catch { ; }
}
but it not work, because note.InnerText is ReadOnly.So, how do i can change the innerText of <p>.
Thanks for read!