How to change the input to uppercase as it is being typed

前端 未结 5 1419
盖世英雄少女心
盖世英雄少女心 2020-12-16 03:08

I am using onkeyup=\"this.value=this.value.toUpperCase();\"to change input text value in uppercase. This is working but my need is to change a single letter in

5条回答
  •  小蘑菇
    小蘑菇 (楼主)
    2020-12-16 03:49

    How about CSS:

    input.upper { text-transform: uppercase; }
    

    Remark: This will still send the value to the server as typed by the user and not uppercased.

提交回复
热议问题