Skip to content

Implement children property on Node? #410

@retorquere

Description

@retorquere

With this script:

const { DOMParser } = require('@xmldom/xmldom')
let source = '<div id="note-body">note</div>';
const parser = new DOMParser()
doc = parser.parseFromString(source, 'text/html');
let root = doc.getElementById('note-body');
console.log(root.children)

I get undefined. Should nodes/the root element not have children properties as per https://developer.mozilla.org/en-US/docs/Web/API/DOMParser/parseFromString ?

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions