function createWebsite(title, heading, content) { const htmlContent = ` ${title}

${heading}

${content}

`; return htmlContent; } function downloadHTML(content, filename) { const blob = new Blob([content], { type: 'text/html' }); const link = document.createElement('a'); link.href = URL.createObjectURL(blob); link.download = filename; link.click(); } // Example usage const title = prompt('Enter the title of your website:'); const heading = prompt('Enter the heading of your website:'); const content = prompt('Enter the main content of your website:'); const generatedHTML = createWebsite(title, heading, content); downloadHTML(generatedHTML, 'index.html');
No Comment
Add Comment
comment url