Answers for "how to remove space in input field html"

5

how to remove space in input field html

let input = document.getElementsByName("my_input")[0];
let val = input.value.replace(/\s/g, "");
alert(val);
Posted by: Guest on August-27-2021

Code answers related to "how to remove space in input field html"

Code answers related to "Javascript"

Browse Popular Code Answers by Language