Element.directText

string directText() @property

Returns the text directly under this element.

Unlike [innerText], it does not recurse, and unlike [firstInnerText], it continues past child tags. So, <example>some <b>bold</b> text</example> will return some text because it only gets the text, skipping non-text children.

See_also: [firstInnerText], [innerText]

void directText(string text) @property

Sets the direct text, without modifying other child nodes.

Unlike [innerText], this does not remove existing elements in the element.

It only replaces the first text node it sees.

If there are no text nodes, it calls [appendText].

So, given <div><img />text here</div>, it will keep the <img />, and replace the text here.