SpeedTest Checker Tool
SpeedTest Checker Tool
Your current internet speed is:
Loading...
body {
font-family: Arial, sans-serif;
margin: 0;
padding: 0;
display: flex;
justify-content: center;
align-items: center;
height: 100vh;
background-color: #f2f2f2;
}
.container {
text-align: center;
padding: 20px;
border: 1px solid #ccc;
border-radius: 10px;
background-color: #fff;
box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}
h1 {
color: #007bff;
}
.result {
margin-top: 20px;
}
#speed {
font-size: 24px;
font-weight: bold;
color: #28a745;
}
button {
margin-top: 20px;
padding: 10px 20px;
font-size: 16px;
border: none;
border-radius: 5px;
background-color: #007bff;
color: #fff;
cursor: pointer;
transition: background-color 0.3s;
}
button:hover {
background-color: #0056b3;
}
const speedTestButton = document.getElementById('run-speedtest');
const speedResult = document.getElementById('speed');
speedTestButton.addEventListener('click', () => {
speedResult.textContent = 'Running...';
// Replace 'YOUR_SPEEDTEST_API_URL' with the actual API URL.
fetch('YOUR_SPEEDTEST_API_URL')
.then(response => response.json())
.then(data => {
// Assuming the API returns the speed in Mbps.
const speed = data.speed || 'N/A';
speedResult.textContent = `${speed} Mbps`;
})
.catch(error => {
speedResult.textContent = 'Error fetching data';
console.error(error);
});
});
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