This project has moved and is read-only. For the latest updates, please go here.

Can i modify innerText of HtmlNode <p>?

Topics: Developer Forum, Project Management Forum, User Forum
Jun 10, 2015 at 5:28 AM
Edited Jun 10, 2015 at 5: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.InnerText = innerText;
                catch { ; }
but it not work, because note.InnerText is ReadOnly.
So, how do i can change the innerText of <p>.
Thanks for read!