how can I add img to the contact and more details?
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Document</title>
</head>
<body>
<button id="save-btn">Save Contact</button>
<script src="script.js"></script>
</body>
</html>
var saveBtn = document.getElementById("save-btn");
saveBtn.addEventListener("click", function () {
// Get the contact information from the website
var contact = {
name: "John Smith",
phone: "555-555-5555",
email: "[email protected]"
};
// create a vcard file
var vcard = "BEGIN:VCARDnVERSION:4.0nFN:" + contact.name + "nTEL;TYPE=work,voice:" + contact.phone + "nEMAIL:" + contact.email + "nEND:VCARD";
var blob = new Blob([vcard], { type: "text/vcard" });
var url = URL.createObjectURL(blob);
const newLink = document.createElement('a');
newLink.download = contact.name + ".vcf";
newLink.textContent = contact.name;
newLink.href = url;
newLink.click();
});
Hey guys, how can I add img to the contact and more details?
And I want to add img for the contact and other details