<html>
<head>
<title>Fake Address Generator Tool</title>
<style>
body {
font-family: Arial, sans-serif;
background-color: #f1f1f1;
}
.container {
max-width: 400px;
margin: 0 auto;
padding: 20px;
background-color: #fff;
border-radius: 5px;
box-shadow: 0 0 10px rgba(0, 0, 0, 0.1);
}
h1 {
text-align: center;
}
label {
display: block;
margin-bottom: 10px;
}
input[type="text"] {
width: 100%;
padding: 10px;
border: 1px solid #ccc;
border-radius: 5px;
}
button {
width: 100%;
padding: 10px;
background-color: #4caf50;
border: none;
color: #fff;
cursor: pointer;
border-radius: 5px;
}
#result {
margin-top: 20px;
padding: 10px;
background-color: #f9f9f9;
border: 1px solid #ccc;
border-radius: 5px;
}
</style>
</head>
<body>
<div class="container">
<h1>Fake Address Generator Tool</h1>
<form id="addressForm">
<label for="country">Country:</label>
<input type="text" id="country" placeholder="Enter country name" required>
<label for="city">City:</label>
<input type="text" id="city" placeholder="Enter city name" required>
<label for="postcode">Postcode:</label>
<input type="text" id="postcode" placeholder="Enter postcode" required>
<label for="street">Street:</label>
<input type="text" id="street" placeholder="Enter street name" required>
<button type="submit">Generate Address</button>
</form>
<div id="result"></div>
</div>
<script>
document.getElementById("addressForm").addEventListener("submit", function(event) {
event.preventDefault();
var country = document.getElementById("country").value;
var city = document.getElementById("city").value;
var postcode = document.getElementById("postcode").value;
var street = document.getElementById("street").value;
var address = generateFakeAddress(country, city, postcode, street);
document.getElementById("result").innerHTML = address;
});
function generateFakeAddress(country, city, postcode, street) {
var address = "<strong>Address:</strong><br>";
address += street + "<br>";
address += city + ", " + postcode + "<br>";
address += country;
return address;
}
</script>
</body>
</html>
No comments:
Post a Comment