Ok so i am making a website which converts kilometer to meter and i take the input when a button is clicked and i take the input with the help of javascript my code is working but in the input box you can even write alphabets which i don't want i want the input box to just accept numeric letters my code
document.getElementById("button1").addEventListener("click",function ktm(){
let ktm1=window. prompt("Enter kilometer's value: ");
alert(ktm1+" kilometer in meters would be "+ktm1*1000+" meters") ;
})
prompt- use an<input type="number"along with code that actively prevents you from even pasting non numbers into itprompt, all you can do is validate the input after the fact and prompt the user again if the input was not numeric.document.getElementById("TotalKilometer").valueon the input.