Change Input to Upper Case

前端 未结 15 774
爱一瞬间的悲伤
爱一瞬间的悲伤 2020-12-07 22:02

JS:



        
15条回答
  •  攒了一身酷
    2020-12-07 22:16

    I think the most elegant way is without any javascript but with css. You can use text-transform: uppercase (this is inline just for the idea):

    
    

    Edit:

    So, in your case, if you want keywords to be uppercase change: keywords: $(".keywords").val(), to $(".keywords").val().toUpperCase(),

提交回复
热议问题