melonJS
    Preparing search index...

    Function getElement

    • return the DOM element for the given element name or HTMLElement object

      Parameters

      • element: string | HTMLElement

        the parent element name or a HTMLElement object

      Returns HTMLElement

      the corresponding DOM Element (falls back to document.body when the lookup fails or the input isn't an HTMLElement). In a runtime with no DOM (a Web Worker, nx.js), a name finds nothing and there is no document.body, so the result is undefined unless an element object was given.