Can i modify innerText of HtmlNode <p>?

Topics: Developer Forum, Project Management Forum, User Forum
Jun 10, 2015 at 4:28 AM
Edited Jun 10, 2015 at 4:38 AM
i have a simple html code
<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 text
i 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!