Skip to content

Commit

Permalink
resetWcagForm
Browse files Browse the repository at this point in the history
  • Loading branch information
scottdavis99 committed Aug 2, 2023
1 parent b50ada5 commit 5665eea
Showing 1 changed file with 15 additions and 1 deletion.
16 changes: 15 additions & 1 deletion index.html
Original file line number Diff line number Diff line change
Expand Up @@ -160,6 +160,8 @@
let top = document.querySelector(`details[data-sc="${scParts[0]}"]`);
top.setAttribute('open', '');
//top.classList.add('fail');
}else{
details.classList.add('pass');
}

let div = document.createElement('div');
Expand Down Expand Up @@ -198,12 +200,24 @@
}

function resetWcagReport(){
// close all open
let open = document.querySelectorAll("details[open]");
console.log(open);
open.forEach((element) => {
element.removeAttribute('open');
});

// remove pass/fail styling
let fails = document.querySelectorAll("details.fail");
fails.forEach((element) => {
element.classList.remove('fail');
});

// remove any lighthouse divs from wcag
let lh = document.querySelectorAll("div[data-lighthouse]");
lh.forEach((element) => {
element.remove();
});

}

</script>
Expand Down

0 comments on commit 5665eea

Please sign in to comment.