Forcing form text to be lower-case

前端 未结 11 1200
面向向阳花
面向向阳花 2021-02-02 10:16

How could I force the text in the \"username\" text input to be lower-case regardless of what user types?

11条回答
  •  不思量自难忘°
    2021-02-02 11:07

    in CSS:

    form input[type="text"] {
        text-transform: lowercase;
    }
    

    otherwise in JS:

    var text="this is my text.";
    var lowercase=text.toLowerCase();
    

提交回复
热议问题