<div id="d1"></div> // js part var div = document.getElemntById("d1") var Name = "saidos" function test(){ div.innerHtml=`<h1>${Name}</h1>` }