article 35, Domain name availability checker for Handshake domains 🤝 under construction
article 35, Domain name availability checker for Handshake domains 🤝
prompt: code html script for a domain name availability checker for Handshake domains from the project at https://handshake.org/
This is still under development…
Here is an example of a simple HTML script that could be used to build a domain name availability checker:
<!-- HTML for the domain name availability checker form -->
<form id="domain-checker-form">
<label for="domain-input">Enter a domain name:</label><br>
<input type="text" id="domain-input" placeholder="example.com"><br>
<button type="submit">Check Availability</button>
</form>
<!-- HTML for displaying the availability status of the domain name -->
<div id="availability-status"></div>
<!-- JavaScript for checking the availability of the domain name -->
<script>
// Reference to the domain checker form and availability status element
const form = document.querySelector('#domain-checker-form');
const status = document.querySelector('#availability-status');
// Handle the form submission event
form.addEventListener('submit', event => {
event.preventDefault();
// Get the domain name from the input field
const domain = document.querySelector('#domain-input').value;
// Send a request to the Handshake API to check the availability of the domain name
fetch(`https://handshake.org/api/check-availability?domain=${domain}`)
.then(response => response.json())
.then(data => {
// Update the availability status element with the result of the availability check
if (data.available) {
status.textContent = 'The domain name is available!';
} else {
status.textContent = 'The domain name is not available.';
}
});
});
</script>
Ongoing Handshake works…