INNER CODE UNIT · JavaScript

applyScopeAttributes

cisagov/ScubaGoggles · scubagoggles/reporter/scripts/main.js:176

const applyScopeAttributes = () => {
    try {

        const tables = document.querySelectorAll("table")

        for (let table of tables) {

            let tbody = table.querySelector("tbody")

            if (!tbody) throw new Error(
                `Invalid HTML structure, <table id='${tables[table]?.getAttribute("id")}'> does not have a <tbody> tag.`
            )

            let cols, rows;

            if (tbody.children && tbody.children.length > 0) {
                for (let child of tbody.children) {
                    if (child.querySelectorAll("tr > th")) {

View source record →

📰 Research Paper
Loading…
⏳ Fetching content…