commajs
Text Node
.domElement
Property that contains the dom element associated witht his node.
AddAttribute(name, value)
Add attribute to the node (including underlying dom element).
RemoveAttribute(name)
Removes attribute from node (including underlying dom element).
isBlockNode()
Returns true if node is a block node.
isInlineNode()
Returns true if node is an inline node.
isTextNode()
Returns true if node is an text node.
IsStyleApplied(styleName)
Returns true if styleName is applied to the node.
ToggleStyle(styleName, value, applyToDom=true, forceOn=false)
Toggles styleName to the node. Returns true if the style was newly applied.
GetBlockContainer()
Returns the block node containing the node
Copy()
Creates a copy of the node. Returns the node newly created.
static CreateNew(_document, tagName, text, nodeStyle=undefined, attributes=[])
Static method to create a new node.
ChangeTagName(tagName)
Function to change the tag name of a node. It will also update the HTML Dom.
DeleteText(startOffset, endOffset)
Deletes text from startOffset character till endOffset character.
SetFocus(offSet=0)
Sets focus at offSet char
SetFocusAtTheEnd(offSet=0)
Sets focus after the last character.
SelectText(startOffset, endOffset)
Selects text from startOffset character till endOffset character.
All Nodes:
.domElement
AddAttribute()
RemoveAttribute()
isBlockNode()
isInlineNode()
isTextNode()
IsStyleApplied()
ToggleStyle()
GetBlockContainer()
Copy()
Text Node:
CreateNew()
ChangeTagName()
DeleteText()
SetFocus()
SetFocusAtTheEnd()
SelectText()
© 2020 Plugg, Inc. All rights reserved. Various trademarks held by their respective owners.
Plugg, Inc. - San Francisco, CA 94114, United States