I am using the following inline script to overlay a help file that shows until you click, the reverts to the original content by removing the dom element. As soon as the document.body.innerHTML+=C; is executed, the checkboxes and data entry fields changed since page load are undone. I know it is completed then because the overlay is partially transparent and I can see that this line of code unchecks boxes and empties fields.
Here is my inline script:
{let Content="";let c="No help content found";
const today = new Date();const year = today.getFullYear();
let C="<div style=\'position:fixed;z-index:110;top:0;left:0;width:100%;height:100%;font-size:16pt;";
C+="color:#000000;background-color:#ccccff;font-family:sans-serif;font-style:normal;font-variant:normal;opacity:0.92;font-weight:normal;";
C+="padding:0px;margin:0px;border:0px;border-style:solid;border-color:#85bb65;overflow:auto;\'";
if (U !== undefined) {Content="";let http=new XMLHttpRequest();http.open("GET", U, false);http.send();Content=http.responseText;}
if (Content !== "") {c=Content;}
C+=" onclick=\"this.remove()\">";
C+="<div style=\'width:98%;margin:auto;\'><center><table border=4><tr><th onclick=\"this.parentNode.parentNode.remove();\">Click to Close<b\
r></th></tr></table><b style=\'font-size:10px;\'>Copyright © Fred Cohen, 2022-"+year+"</b></center>"+c+"</div></div>";
document.body.innerHTML+=C;
return("");};```
Does anybody know why this is? And is there anything I can do about it other than to first collect all content from all fields and restore it all so this little routine will not clear fields? What am I missing here?