Method clear
Clears an object's innerHTML, or resets it's state
Parameters:
Returns an Object
(Element)
Method create
Creates an Element in document.body or a target Element An id is generated if not specified with args
Parameters:
type must be a String.
(Type of Element to create)
args must be an Object.
([Optional] Collection of properties to apply to the new element)
target can be of any type.
([Optional] Target Element)
pos can be of any type.
([Optional] "first", "last" or Object describing how to add the new Element, e.g. {before: referenceElement})
Returns a Mixed
(Element that was created, or an Array if type
is a String of multiple Elements (frag))
Removing potential HTML template formatting
String injection, create a frag and apply it
Original syntax
Method css
Gets or sets a CSS style attribute on an Element
Parameters:
obj can be of any type.
(Element)
key must be a String.
(CSS to put in a style tag)
value must be a String.
([Optional] Value to set)
Returns an Object
(Element)
Method data
Data attribute facade acting as a getter (with coercion) & setter
Parameters:
obj can be of any type.
(Element)
key must be a String.
(Data key)
value can be of any type.
(Boolean, Number or String to set)
Returns a Mixed
(undefined, Element or value)
Method destroy
Destroys an Element
Parameters:
Returns an Undefined
(undefined)
Method disable
Disables an Element
Parameters:
Returns an Object
(Element)
Method dispatch
Dispatches a DOM Event from an Element
data
will appear as Event.detail
Parameters:
obj must be an Object.
(Element which dispatches the Event)
type must be a String.
(Type of Event to dispatch)
data must be an Object.
(Data to include with the Event)
bubbles must be a Boolean.
([Optional] Determines if the Event bubbles, defaults to true
)
cancelable must be a Boolean.
([Optional] Determines if the Event can be canceled, defaults to true
)
Returns an Object
(Element which dispatches the Event)
Method enable
Enables an Element
Parameters:
Returns an Object
(Element)
Method find
Finds descendant childNodes of Element matched by arg
Parameters:
obj can be of any type.
(Element to search)
arg must be a String.
(Comma delimited string of descendant selectors)
Returns a Mixed
(Array of Elements or undefined)
Method frag
Creates a document fragment
Parameters:
Returns an Object
(Document fragment)
Method has
Determines if Element has descendants matching arg
Parameters:
obj can be of any type.
(Element or Array of Elements or $ queries)
arg must be a String.
(Type of Element to find)
Returns a Boolean
(True if 1 or more Elements are found)
Method hasClass
Determines if obj has a specific CSS class
Parameters:
Returns a Mixed
(Element, Array of Elements or undefined)
Method hidden
Returns a Boolean indidcating if the Object is hidden
Parameters:
Returns a Boolean
(True if hidden)
Method html
Gets or sets an Elements innerHTML
Parameters:
obj must be an Object.
(Element)
arg must be a String.
([Optional] innerHTML value)
Returns an Object
(Element)
Method is
Determines if Element is equal to arg, supports nodeNames & CSS2+ selectors
Parameters:
obj can be of any type.
(Element)
arg must be a String.
(Property to query)
Returns a Boolean
(True if a match)
Method isAlphaNum
Tests if Element value or text is alpha-numeric
Parameters:
Returns a Boolean
(Result of test)
Method isBoolean
Tests if Element value or text is a boolean
Parameters:
Returns a Boolean
(Result of test)
Method isChecked
Tests if Element value or text is checked
Parameters:
Returns a Boolean
(Result of test)
Method isDate
Tests if Element value or text is a date
Parameters:
Returns a Boolean
(Result of test)
Method isDisabled
Tests if Element value or text is disabled
Parameters:
Returns a Boolean
(Result of test)
Method isDomain
Tests if Element value or text is a domain
Parameters:
Returns a Boolean
(Result of test)
Method isEmail
Tests if Element value or text is an email address
Parameters:
Returns a Boolean
(Result of test)
Method isEmpty
Tests if Element value or text is empty
Parameters:
Returns a Boolean
(Result of test)
Method isIP
Tests if Element value or text is an IP address
Parameters:
Returns a Boolean
(Result of test)
Method isInt
Tests if Element value or text is an integer
Parameters:
Returns a Boolean
(Result of test)
Method isNumber
Tests if Element value or text is numeric
Parameters:
Returns a Boolean
(Result of test)
Method isPhone
Tests if Element value or text is a phone number
Parameters:
Returns a Boolean
(Result of test)
Method isUrl
Tests if Element value or text is a URL
Parameters:
Returns a Boolean
(Result of test)
Method klass
Adds or removes a CSS class
Parameters:
obj can be of any type.
(Element)
arg must be a String.
(Class to add or remove ( can be a wildcard ))
add must be a Boolean.
(Boolean to add or remove, defaults to true)
Returns an Object
(Element)
Method position
Finds the position of an element
Parameters:
Returns an Array
(Coordinates [left, top, right, bottom])
Method prependChild
Prepends an Element to an Element
Parameters:
obj must be an Object.
(Element)
child must be an Object.
(Child Element)
Returns an Object
(Element)
Method removeAttr
Removes an Element attribute
Parameters:
obj can be of any type.
(Element)
key must be a String.
(Attribute name)
Returns an Object
(Element)
Method scrollTo
Scrolls to the position of an Element
Parameters:
obj must be an Object.
(Element to scroll to)
ms must be a Number.
([Optional] Milliseconds to scroll, default is 250, min is 100)
Returns an Object
(Deferred)
Method serialize
Serializes the elements of an Element
Parameters:
obj must be an Object.
(Element)
string must be a Boolean.
([Optional] true if you want a query string, default is false ( JSON ))
encode must be a Boolean.
([Optional] true if you want to URI encode the value, default is true)
Returns a Mixed
(String or Object)
Method size
Returns the size of the Object
Parameters:
Returns an Object
(Size {height: n, width:n})
Method text
Getter / setter for an Element's text
Parameters:
obj must be an Object.
(Element)
arg must be a String.
([Optional] Value to set)
Returns an Object
(Element)
Method toggleClass
Toggles a CSS class
Parameters:
obj must be an Object.
(Element, or $ query)
arg must be a String.
(CSS class to toggle)
Returns an Object
(Element)
Method update
Updates an Element
Parameters:
obj can be of any type.
(Element)
args must be an Object.
(Collection of properties)
Returns an Object
(Element)
Method val
Gets or sets the value of Element
Parameters:
obj can be of any type.
(Element)
value can be of any type.
([Optional] Value to set)
Returns an Object
(Element)
Method validate
Validates the contents of Element
Parameters:
Returns an Object
(Result of test)
Method attr
Parameters:
obj can be of any type.
(Element)
name must be a String.
(Attribute name)
value can be of any type.
(Attribute value)
Returns an Object
(Element)