Fake Address Generator Tool
Fake Address Generator Tool
body {
background-color: #f1f1f1;
}
.container {
max-width: 600px;
margin: 0 auto;
background-color: #fff;
padding: 20px;
border-radius: 5px;
}
.address-result {
display: none;
}
.address-details {
background-color: #f5f5f5;
padding: 10px;
border-radius: 5px;
}
/* Add custom styling as per your preference */
// Address data for different countries
const addressData = {
USA: {
street: ['1234 Elm Street', '5678 Oak Avenue', '910 Maple Drive'],
city: ['New York', 'Los Angeles', 'Chicago', 'Houston', 'Miami'],
state: ['NY', 'CA', 'IL', 'TX', 'FL'],
postalCode: ['10001', '90001', '60601', '77001', '33101'],
},
UK: {
street: ['1 Baker Street', '34 Oxford Road', '56 Abbey Lane'],
city: ['London', 'Manchester', 'Birmingham', 'Edinburgh'],
state: ['ENG', 'SCT', 'WLS', 'NIR'],
postalCode: ['SW1A 0AA', 'M1 1AA', 'B1 1AA', 'EH1 1AA'],
},
Canada: {
street: ['789 Yonge Street', '456 Bay Street', '321 Queen Street'],
city: ['Toronto', 'Vancouver', 'Montreal', 'Calgary'],
state: ['ON', 'BC', 'QC', 'AB'],
postalCode: ['M5B 1S4', 'V6C 3K4', 'H3B 1A7', 'T2P 1J9'],
},
};
const addressForm = document.getElementById('addressForm');
const generatedAddress = document.getElementById('generatedAddress');
addressForm.addEventListener('submit', function (event) {
event.preventDefault();
const countrySelect = document.getElementById('country');
const selectedCountry = countrySelect.value;
if (selectedCountry) {
const randomIndex = Math.floor(Math.random() * addressData[selectedCountry].street.length);
const street = addressData[selectedCountry].street[randomIndex];
const city = addressData[selectedCountry].city[randomIndex];
const state = addressData[selectedCountry].state[randomIndex];
const postalCode = addressData[selectedCountry].postalCode[randomIndex];
const fullAddress = `${street}, ${city}, ${state} ${postalCode}, ${selectedCountry}`;
generatedAddress.textContent = fullAddress;
document.querySelector('.address-result').style.display = 'block';
}
});
Documentation
Step 1:- Open txt file from the folder for code
Step 2:- Copy all code
Step 3:- Open your website dashboard or blog
Step 4:- Add HTML element
Step 5:- Paste all code in your html element
Step 6:- Save file
Done you are successfully Pasted code in your website.
0 Comments