If you type any element class name in this code it will disappear with in 2 seconds
document.addEventListener("DOMContentLoaded",function(){setTimeout(function(){varelement=document.querySelector('.className');if(element){element.remove();}},2000);// 2 second in remove});
№ 3 , You can use JavaScript to link the styles.css file to your HTML page in one of the following ways:
1. Creating a link tag using JavaScript
// Create a link element to link the CSS filevarlink=document.createElement('link');link.rel='stylesheet';link.type='text/css';link.href='styles.css';// The path to the CSS filelink.media='all';// add the link element to the head tagdocument.getElementsByTagName('head')[0].appendChild(link);
№ 4 , Create Element <head> in
// Create Element <div id="root"></div>constrootDiv=document.createElement('div');rootDiv.id='root';document.body.appendChild(rootDiv);letroot=document.querySelector('#root')