HTML and Plain text

<< Click to Display Table of Contents >>

Navigation:  »No topics above this level«

HTML and Plain text

THtDocument and TElement has properties for getting and setting inner and outer HTML and inner text:

 

InnerHTML - get or set inner HTML

OuterHTML  - get or set outer HTML

InnerText - get or set inner text (plain).

 

Example:

 

E := Doc.GetElementById('mydiv');
if Assigned(E) then
  E.InnerHTML := '<b>New Content</b>';

 

Also HTML can be set using JQuery or XPath. Example:

 

Doc.JQuery('.myclass').html := 'New content';

 

Adding text to nodes:

 

Doc.JQuery('.myclass').text := 'Added text content';