javascript - How do I force lowercase on an input field? -
i have input field client wants lowercase only. output generates input lowercase.
this have , isn't working.
<script> function tolowercase(email) { strinput.value=strinput.value.tolowercase(); } </script>
use oninput
:
var input = document.getelementsbytagname("input")[0] // input element input.oninput = function() { input.value = input.value.tolowercase() }
<input type="text" />
Comments
Post a Comment