Class: shaka.util.Dom

Constructor

new Dom()

Source:

Methods

asHTMLElement(original) → {HTMLElement}

Cast a Node/Element to an HTMLElement
Parameters:
Name Type Description
original Node | Element
Source:
Returns:
Type
HTMLElement

asHTMLMediaElement(original) → {HTMLMediaElement}

Cast a Node/Element to an HTMLMediaElement
Parameters:
Name Type Description
original Node | Element
Source:
Returns:
Type
HTMLMediaElement

createButton() → {HTMLButtonElement}

Create a "button" element with the correct type. The compiler is very picky about the use of the "disabled" property on HTMLElement, since it is only defined on certain subclasses of that. This method merely creates a button and casts it to the correct type.
Source:
Returns:
Type
HTMLButtonElement

createHTMLElement(tagName) → {HTMLElement}

Creates an element, and cast the type from Element to HTMLElement.
Parameters:
Name Type Description
tagName string
Source:
Returns:
Type
HTMLElement

getElementByClassName(className, parentnon-null) → {HTMLElement}

Returns the element with a given class name. Assumes the class name to be unique for a given parent.
Parameters:
Name Type Description
className string
parent HTMLElement
Source:
Returns:
Type
HTMLElement

removeAllChildren(elementnon-null)

Remove all of the child nodes of an element.
Parameters:
Name Type Description
element Element
Source: