Improve it
All checks were successful
/ deploy (push) Successful in 1m0s

This commit is contained in:
Minecon724 2025-03-19 20:37:57 +01:00
commit 51a8a386d9
Signed by: Minecon724
GPG key ID: A02E6E67AB961189
2 changed files with 3 additions and 7 deletions

View file

@ -13,6 +13,6 @@
}
</style>
<input type="number" min="0" placeholder="your ASN" oninput="onAsnInput(this)">
<input type="text" placeholder="your ASN" oninput="onAsnInput(this)" onkeypress="return event.charCode >= 48 && event.charCode <= 57">
<p>Port: <span id="result"></span></p>
</html>

View file

@ -1,11 +1,7 @@
function onAsnInput(inputElement) {
inputElement.value = inputElement.value.replace(/(?![0-9])./gmi,'');
let portElement = document.getElementById('result');
if (inputElement.value == '') {
portElement.innerText = '';
return;
}
portElement.innerText = calculate(inputElement.value);
}