let input = document.getElementsByName("my_input")[0]; let val = input.value.replace(/s/g, ""); alert(val);