Model structured documents with elements, attributes, namespaces, schemas, parsing, and transformations.
Lessons
Fetch XML and other data from the browser.
XMLHttpRequest is easiest to learn by reading the example, changing it, and observing the result.
const xmlText = `
<lessons>
<lesson level="beginner"><title>XML Basics</title></lesson>
</lessons>`;
const doc = new DOMParser().parseFromString(xmlText, 'application/xml');
const title = doc.querySelector('lesson > title').textContent;
const level = doc.querySelector('lesson').getAttribute('level');
console.log(title, level);Practice the XMLHttpRequest example in a small scratch file, then explain what changed and why.