forked from R74nCom/R74n-Main
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathcw.js
More file actions
14 lines (14 loc) · 667 Bytes
/
cw.js
File metadata and controls
14 lines (14 loc) · 667 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
window.addEventListener("DOMContentLoaded",function(){
var elements = document.getElementsByClassName("cw");
for (var i = 0; i < elements.length; i++) {
var element = elements.item(i);
var warning = element.getAttribute("value");
var content = element.innerHTML;
if (element.getAttribute("open")==null) {element.setAttribute("open","false")}
if (element.getAttribute("open")=="false") {
element.setAttribute("onclick","this.innerHTML=`"+content.replace('"','\\"')+"`;this.setAttribute('open','true');this.removeAttribute('onclick')")
element.innerHTML = warning;
}
//console.log(elements.item(i).getAttribute("open"));
}
})