Hi i need your help guys im new on javascript or jquery im trying to add a html code inside the overlay element but its not working im using $( "overlay" ).append( "Hello" ); this one but its not working
the js below outputs what im trying to do is to input an html code inside it
init=()=>{
//SELECT & BIND (CLICK) EVENT
document.querySelector('a.menuToggle, a#welcomeDivs').addEventListener('click',modal.overlay.init);
}
modal={
overlay:{
init:()=>{
//CREATE OVERLAY
var overlay = document.createElement('overlay');
overlay.id = 'welcomeDivsss';
//SET (CLICK) EVENT TO REMOVE ITSLEF
overlay.addEventListener('click',modal.overlay.remove);
$( "overlay" ).append( "<strong>Hello</strong>" );
//APPEND TO INTERFACE
document.body.appendChild(overlay);
},
remove:(e)=>{
//REMOVE ITSELF
e.target.parentNode.removeChild(e.target);
}
}
}
//ON DOCUMENT LOAD RUN INIT
document.addEventListener('DOMContentLoaded',init);
$("#overlay")<overlay>tag doesn't exist in html. Try using<div id="welcomeDivsss"></div>and then use the same code as in my answer. Let me know if that fixes it for you