Fake Address Generator
Fake Address Generator
Name:
Street:
City:
State:
Zip Code:
Country:
body {
font-family: Arial, sans-serif;
text-align: center;
background-color: #f5f5f5;
margin: 0;
padding: 0;
}
.generator-container {
max-width: 400px;
margin: 0 auto;
padding: 20px;
background-color: #fff;
border-radius: 8px;
box-shadow: 0 0 10px rgba(0, 0, 0, 0.2);
}
h1 {
color: #333;
}
button {
padding: 10px 20px;
background-color: #007bff;
color: #fff;
border: none;
cursor: pointer;
}
#address {
display: none;
margin-top: 20px;
text-align: left;
}
#address p {
margin: 5px 0;
}
#address strong {
font-weight: bold;
}
// Sample fake address data
const addresses = [
{
name: "John Doe",
street: "123 Main St",
city: "Anytown",
state: "CA",
zip: "12345",
country: "United States"
},
{
name: "Jane Smith",
street: "456 Elm St",
city: "Another Town",
state: "NY",
zip: "67890",
country: "United States"
},
// Add more fake addresses as needed
];
document.addEventListener("DOMContentLoaded", function() {
const generateButton = document.getElementById("generate-button");
const addressDiv = document.getElementById("address");
const nameSpan = document.getElementById("name");
const streetSpan = document.getElementById("street");
const citySpan = document.getElementById("city");
const stateSpan = document.getElementById("state");
const zipSpan = document.getElementById("zip");
const countrySpan = document.getElementById("country");
generateButton.addEventListener("click", function() {
const randomIndex = Math.floor(Math.random() * addresses.length);
const randomAddress = addresses[randomIndex];
nameSpan.textContent = randomAddress.name;
streetSpan.textContent = randomAddress.street;
citySpan.textContent = randomAddress.city;
stateSpan.textContent = randomAddress.state;
zipSpan.textContent = randomAddress.zip;
countrySpan.textContent = randomAddress.country;
addressDiv.style.display = "block";
});
});