How could I force the text in the \"username\" text input to be lower-case regardless of what user types?
input
@fdiv_bug's answer is good except for the issues mentioned in the comments of their answer. Using the input event instead of the keyup event fixed those issues for me.
HTML:
Javascript:
element.addEventListener('input',function(){this.value=this.value.toLowerCase()});