Node

A HTML Node

Constructors

this
this(ref Tree tree, MyHtmlTagId tag, MyHtmlNamespace ns = MyHtmlNamespace.html)

Create a new html node

Members

Functions

appendChild
void appendChild(Node n)
attributes
auto attributes()

All node's attributes

byAttribute
auto byAttribute(string key, string value)

Search children by tag attribute key/val.

byAttributeKey
auto byAttributeKey(string name)

Search children with a specified attribute

byClass
auto byClass(string className)

Search children by class (space separated)

byCssSelector
auto byCssSelector(string selector)

Search children using a css 3.1 selector

byId
auto byId(string id)

Search children by id

byTagName
auto byTagName(MyHtmlTagId name)
auto byTagName(string name)

Search children by tag name

clone
Node clone(Tree destination)

Create a copy of this node owned by another tree

deleteNode
void deleteNode()

Remove node from tree and delete it

detach
void detach()

Detach node from tree without destroying

firstChild
Nullable!Node firstChild()
insertAfter
void insertAfter(Node n)
insertBefore
void insertBefore(Node n)
insertToAppropriatePlace
void insertToAppropriatePlace(Node n)
isSelfClosing
bool isSelfClosing()
isVoidElement
bool isVoidElement()
lastChild
Nullable!Node lastChild()
next
Nullable!Node next()
opBinaryRight
bool opBinaryRight(string key)

"in" operator to check for an attribute inside a node

opIndex
auto opIndex(string attribute)

Read an attribute from node

opIndexAssign
auto opIndexAssign(string value, string key)

Write an attribute

parent
Nullable!Node parent()
previous
Nullable!Node previous()
removeAttribute
bool removeAttribute(string key)

Remove an attribute

tagId
MyHtmlTagId tagId()

Get the tag id for this node (ex: a, div, body, ...)

toString
string toString()
innerHTML
string innerHTML [@property getter]

Return node html representation

Properties

innerHTML
string innerHTML [@property setter]

Set node html. All children will be deleted.

innerText
string innerText [@property setter]

Set node innerText. All children will be deleted.

innerText
string innerText [@property getter]
text
string text [@property getter]

Get the text of this node. Only for text nodes!

text
string text [@property setter]

Set the text of this node. Only for text nodes!

Meta