This blog uses responsible cookies for functionality and user preferences.
Google Analytics is used for collecting general public information to understand how my blog is used.
Learn moreDear visitors,
This blog and the Tigarus.com network will be changing our website software in May (2024). There will be some down time and there will be a change to the webpage addresses.
We will also be removing the Anime blogs. The Rocksmith Songs website will be unavailable of a few weeks or months while I move the database to the new software.
At the moment we are running on Wordpress, the new software is an in-house project which is 57 times faster. It will also provide more freedom for development.
Thank you for understanding.
Script Title: DOM API
Script Language: JavaScript
Date Created: 2020-06-04
Purpose: Provides short-cuts for the DOM selector functions, essential features, and legacy support.
Description: DOM API is a short-cuts application programming interface (API) for the Document Object Model (DOM) programming interface in HTML. DOM is easy to remember and save time by providing a shorten language. DOM also provides essential commonly used functions, and legacy support across browsers.
Example:
document.getElementById(“myElementID”);
// DOM API (alias)
dom.getID(“myElementID”);
Methods:
dom.getID( string )
Alias for getElementsById, returns an element
dom.getTagged( string )
Alias for getElementsByTagName, returns an array of elements
dom.getTaggedFirst( string )
Returns the first element from getElementsByTagName
dom.getTaggedLast( string )
Returns the last element from getElementsByTagName
dom.getForByID( string )
Returns the element from the ID assigned to a For attribute
dom.query( string )
Alias for querySelector, returns an element
Basic legacy support ( [attr], [attr=”name”], .classNS, Element.classNS, Element )dom.queryAll( string )
Alias for querySelectorAll, returns an array of elements
Basic legacy support ( [attr], [attr=”name”], .classNS, Element.classNS, Element )dom.addEvent( event, function )
Set an event for the document/window
( Do not include ‘on’ )dom.addLoadEvent( function )
Set a function to execute when the document/window has loaded
dom.delEvent( event, function )
Removes an event for the document/window
dom.fireEvent( event )
Activates an event for the document/window
dom.empty( value )
Determines if the value is empty, returns a boolean
dom.isSet( value )
Determines if the value is set, returns a boolean
dom.type( value )
Returns the data or object type, returns a string
Examples: array, object, HTMLElementdom.trim( string )
Removes unwanted spaces from start and end of a string, returns a string
dom.iFrame( elm ).format()
A function to create the HTML document in a created iFrame
dom.iFrame( elm ).isAccessible()
Determines if iFrame is accessible, returns a boolean
dom.iFrame( elm ).getID( string )
Alias for getElementsById within an iFrame, returns an element
dom.iFrame( elm ).getTagged( string )
Alias for getElementsByTagName within an iFrame, returns an array of elements
dom.iFrame( elm ).getTaggedFirst( string )
Returns the first element from getElementsByTagName within an iFrame
dom.iFrame( elm ).getTaggedLast( string )
Returns the last element from getElementsByTagName within an iFrame
dom.iFrame( elm ).getForByID( string )
Returns the element from the ID assigned to a For attribute within an iFrame
dom.iFrame( elm ).getDoc()
Returns the document/window element of the iFrame
dom.iFrame( elm ).query( string )
Alias for querySelector, returns an element
Basic legacy support ( [attr], [attr=”name”], .classNS, Element.classNS, Element )dom.iFrame( elm ).queryAll( string )
Alias for querySelectorAll, returns an array of elements
Basic legacy support ( [attr], [attr=”name”], .classNS, Element.classNS, Element )dom.iFrame( elm ).addEvent( event, function )
Set an event for the iFrame document/window
( Do not include ‘on’ )dom.iFrame( elm ).delEvent ( event, function )
Removes an event for the iFrame document/window
dom.iFrame( elm ).fireEvent ( event )
Activates an event for the iFrame document/window
dom.elm( elm | ID ).addEvent( event, function )
Set an event for an element
( Do not include ‘on’ )dom.elm( elm | ID ).delEvent ( event, function )
Removes an event for an element
dom.elm( elm | ID ).fireEvent ( event )
Activates an event for an element
dom.elm( elm | ID ).getParent()
Returns the parent element
dom.elm( elm | ID ).isValue()
Determines if the element has the value property, returns a boolean
dom.elm( elm | ID ).setValues( array, value )
Sets the value to the given array options: value, text, index, attribute
dom.elm( elm | ID ).getValueFrom( string )
Returns the value from the option: value, text, index, attribute
dom.elm( elm | ID ).insert( elm, position )
Inserts a created element or moves an element to a position
(0 ‘first’ child, 1 ‘last’ child, 2 ‘above’ element, 3 ‘below’ element, 4 ‘body’)dom.elm( elm | ID ).remove()
Removes an element
dom.elm( elm | ID ).hasClassNS( string )
Determines if an element has a class name, returns a boolean
dom.elm( elm | ID ).addClassNS( string )
Appends a class name to an element
dom.elm( elm | ID ).delClassNS( string )
Removes a class name from an element
dom.elm( elm | ID ).getCurrentStyle( string )
Returns the value of computed style from an elements
dom.elm( elm | ID ).getID( string )
Alias for getElementsById within an element, returns an element
dom.elm( elm | ID ).getTagged( string )
Alias for getElementsByTagName within an element, returns an array of elements
dom.elm( elm | ID ).getTaggedFirst( string )
Returns the first element from getElementsByTagName within an element
dom.elm( elm | ID ).getTaggedLast( string )
Returns the last element from getElementsByTagName within an element
dom.elm( elm | ID ).getFor( string )
Returns the element from the ID assigned to a For attribute
dom.elm( elm | ID ).query( string )
Alias for querySelector, returns an element from within an element
Basic legacy support ( [attr], [attr=”name”], .classNS, Element.classNS, Element )dom.elm( elm | ID ).queryAll( string );
Alias for querySelectorAll, returns an array of elements from within an element
Basic legacy support ( [attr], [attr=”name”], .classNS, Element.classNS, Element )
Selector Chains and Nested Selectors
document.getElementById(“myElementID”).querySelector (“[myAttribute=’first’]”);
// alias first selector
dom.getID(“myElementID”).querySelector(“[myAttribute=’first’]”);
// alias
dom.elm(“myElementID”).query(“[myAttribute=’first’]”);
Terms of Use, Cookies, Privacy, and more, see Terms and Privacy
Third-party copyrights and trademarks featured on this site are owned by their respected holders.
Website written and designed by Patcoola 2019, some rights reserved.
This blog uses responsible cookies for functionality and user preferences.
Google Analytics is used for collecting general public information to understand how my blog is used.
Learn moreDear EU visitor, I am required to ask you consent for the following.