`; element.setAttribute('href', 'data:text/html;charset=utf-8,' + encodeURIComponent( inshtml ) ); element.setAttribute('download', filename); element.style.display = 'none'; document.body.appendChild(element); element.click(); document.body.removeChild(element); }