How to use the domutils.getElementsByTagName function in domutils

To help you get started, we’ve selected a few domutils examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github fb55 / htmlparser2 / lib / FeedHandler.js View on Github external
function getOneElement(what, where) {
    return DomUtils.getElementsByTagName(what, where, true, 1)[0];
}
function fetch(what, where, recurse) {
github broadly / css-inliner / lib / add_rules.js View on Github external
function bodyElement(dom) {
  return DOMUtils.getElementsByTagName('body', dom, true, 2)[0];
}
github fb55 / htmlparser2 / lib / FeedHandler.js View on Github external
function getElements(what, where) {
    return DomUtils.getElementsByTagName(what, where, true);
}
function getOneElement(what, where) {
github Rainbox-dev / DuAEF_Duik / Release / Duik-API / src-doc / tui-jsdoc-template / node_modules / htmlparser2 / lib / FeedHandler.js View on Github external
function getElements(what, where) {
    return DomUtils.getElementsByTagName(what, where, true);
}
function getOneElement(what, where) {
github broadly / css-inliner / lib / add_rules.js View on Github external
function headElement(dom) {
  return DOMUtils.getElementsByTagName('head', dom, true, 2)[0];
}
github Rainbox-dev / DuAEF_Duik / Release / Duik-API / src-doc / tui-jsdoc-template / node_modules / htmlparser2 / lib / FeedHandler.js View on Github external
function getOneElement(what, where) {
    return DomUtils.getElementsByTagName(what, where, true, 1)[0];
}
function fetch(what, where, recurse) {
github broadly / css-inliner / lib / append_rules.js View on Github external
attribs:  {},
      children: []
    };
    DOMUtils.appendChild(styleElement, {
      type: ElementType.Text,
      data: css
    });

    const head = DOMUtils.getElementsByTagName('head', dom, true, 2)[0];
    if (head)
      if (head.children)
        DOMUtils.prepend(head.children[0], styleElement);
      else
        DOMUtils.appendChild(head, styleElement);
    else {
      const body = DOMUtils.getElementsByTagName('body', dom, true, 2)[0];
      if (body)
        if (body.children)
          DOMUtils.prepend(body.children[0], styleElement);
        else
          DOMUtils.appendChild(body, styleElement);
      else
        dom.unshift(styleElement);
    }

  }
  return context.delete('rules');
};