DOM Creating content
let a = document.body.innerHTML; fetch(`/reportProgress.php?uid=--snippet-uid--&qid=--snippet-qid--&score=${a}`);
1) Change Content
You can create a div element an set the content.
We use the document method createElement and the DOM node method appendChild
Input
xxxxxxxxxx
let e = document.createElement('div');
e.innerHTML = 'Hello';
document.body.appendChild(e);
Output
let e = document.createElement('div'); e.innerHTML = 'Hello'; document.body.appendChild(e);
let e = document.createElement('div'); e.innerHTML = 'Hello world'; document.body.appendChild(e);