Name card generator
https://www.blogger.com/blog/layout/1863906503428169747
Name Card Generator
CSS (styles.css):body {
display: flex;
justify-content: center;
align-items: center;
height: 100vh;
margin: 0;
}
document.write(' ');
.card {
border: 1px solid #ccc;
padding: 20px;
text-align: center;
max-width: 300px;
}JavaScript (script.js):document.addEventListener("DOMContentLoaded", function() {
// Prompt the user for input
var name = prompt("Enter your name:");
var jobTitle = prompt("Enter your job title:");
var email = prompt("Enter your email:");
document.write(' ');
// Update the card content with user input
document.getElementById("name").innerText = name || "Your Name";
document.getElementById("jobTitle").innerText = jobTitle || "Job Title";
document.getElementById("email").innerText = "Email: " + (email || "example@email.com");
});This is a basic example, and you can enhance and customize it further based on your specific requirements. The JavaScript part prompts the user for input and updates the content of the HTML elements accordingly.
document.write(' ');
Your Name
Job Title
Email: example@email.com
Comments