Send/Recieve Files Online (Recieve Files by Enter 6 Digit Code) 👉

X
Code copied to clipboard!

POMSD

Advertisement

Create Internet Spped Test

Image
HTML
    
   <!DOCTYPE html>
<html>
<head>
    <title>Internet Speed Test</title>
    <link rel="stylesheet" type="text/css" href="style.css">
</head>
<body>
    <div class="container">
        <h1>Internet Speed Test</h1>
        <button id="start-button">Start Test</button>
        <div id="result"></div>
    </div>

    <script src="script.js"></script>
</body>
</html>
  
CSS
    
<style>
.container {
    text-align: center;
    padding: 20px;
}

h1 {
    font-size: 24px;
    margin-bottom: 20px;
}

button {
    padding: 10px 20px;
    font-size: 18px;
}

#result {
    font-size: 18px;
    margin-top: 20px;
}
</style>
  
Js
    
   <script>
window.addEventListener('load', () => {
    const startButton = document.getElementById('start-button');
    const resultDiv = document.getElementById('result');

    startButton.addEventListener('click', () => {
        resultDiv.innerHTML = 'Testing...';

        // Simulate network speed test
        setTimeout(() => {
            const downloadSpeed = Math.floor(Math.random() * 100) + 1;
            const uploadSpeed = Math.floor(Math.random() * 100) + 1;

            resultDiv.innerHTML = `Download Speed: ${downloadSpeed} Mbps<br>Upload Speed: ${uploadSpeed} Mbps`;
        }, 3000); // Simulate test for 3 seconds
    });
});
</script>
  
Also Read this Posts

Contact Us!

Comment Box

0 Comments