Answers for "js document append"

1

javascript append to document

var elem = document.createElement('div');
elem.style.cssText = 'position:absolute;width:100%;height:100%;opacity:0.3;z-index:100;background:#000';
document.body.appendChild(elem);
Posted by: Guest on May-23-2021
1

document.append

/*adds  a element directly to the document without needing a parent or 
container*/

let addTag = document.createElement("html")
document.append(addTag)

//or

let addTag2 = document.createElement("p")
document.body.append(addTag2)
Posted by: Guest on January-17-2022

Code answers related to "Javascript"

Browse Popular Code Answers by Language