MCPcopy Index your code
hub / github.com/pyscript/pyscript / wrap_dom_element

Method wrap_dom_element

core/src/stdlib/pyscript/web.py:462–472  ·  view source on GitHub ↗

Wrap a DOM element in the appropriate `Element` subclass. Looks up the subclass by tag name. Unknown tags use the base `Element` class.

(cls, dom_element)

Source from the content-addressed store, hash-verified

460
461 @classmethod
462 def wrap_dom_element(cls, dom_element):
463 """
464 Wrap a DOM element in the appropriate `Element` subclass.
465
466 Looks up the subclass by tag name. Unknown tags use the base `Element`
467 class.
468 """
469 element_cls = cls.element_classes_by_tag_name.get(
470 dom_element.tagName.lower(), cls
471 )
472 return element_cls(dom_element=dom_element)
473
474 def __init__(self, dom_element=None, classes=None, style=None, **kwargs):
475 """

Callers 6

_wrap_if_not_noneFunction · 0.80
parentMethod · 0.80
cloneMethod · 0.80
optionsMethod · 0.80
wrap_dom_elementsMethod · 0.80
__init__Method · 0.80

Calls 1

getMethod · 0.45

Tested by

no test coverage detected