Node

A HTML Node

Constructors

this
this()
Undocumented in source.
this
this(Tree tree, MyHtmlTagId tag, MyHtmlNamespace ns)

Create a new html node

Destructor

~this
~this()
Undocumented in source.

Postblit

this(this)
this(this)
Undocumented in source.

Members

Functions

appendChild
void appendChild(Node n)
appendComment
void appendComment(string s)

Fast way to append a comment node

appendText
void appendText(string s)

Fast way to append a text node

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

children
auto children()
Undocumented in source. Be warned that the author may not have intended to support it.
clone
Node clone(Tree destination)

Create a copy of this node owned by another tree

clone
Node clone()

Create a copy of this node

deleteNode
void deleteNode()

Remove node from tree and delete it

detach
void detach()

Detach node from tree without destroying

firstChild
Node firstChild()
insertAfter
void insertAfter(Node n)
insertBefore
void insertBefore(Node n)
insertToAppropriatePlace
void insertToAppropriatePlace(Node n)
isNull
bool isNull()

Check if node is null / empty

isSelfClosing
bool isSelfClosing()
isVoidElement
bool isVoidElement()
lastChild
Node lastChild()
next
auto next()
opAssign
void opAssign(Node rhs)
Undocumented in source. Be warned that the author may not have intended to support it.
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

opIndexAssign
auto opIndexAssign(typeof(null) value, string key)
Undocumented in source. Be warned that the author may not have intended to support it.
parent
auto parent()
previous
auto previous()
removeAttribute
bool removeAttribute(string key)

Remove an attribute

tag
string tag()
Undocumented in source. Be warned that the author may not have intended to support it.
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]
Undocumented in source. Be warned that the author may not have intended to support it.
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