I am creating a light box in pure JavaScript. For that I am making an overlay. I want to add this overlay to body but I also want to keep the content on the page. My current
Using Javascript
var elemDiv = document.createElement('div'); elemDiv.style.cssText = 'position:absolute;width:100%;height:100%;opacity:0.3;z-index:100;background:#000;'; document.body.appendChild(elemDiv);
Using jQuery
$('body').append('');