Change Input to Upper Case

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

JS:



        
15条回答
  •  南方客
    南方客 (楼主)
    2020-12-07 22:34

    Here we use onkeyup event in input field which triggered when the user releases a Key. And here we change our value to uppercase by toUpperCase() function.

    Note that, text-transform="Uppercase" will only change the text in style. but not it's value. So,In order to change value, Use this inline code that will show as well as change the value

    Here is the code snippet that proved the value is change

    
    
    
    	
    
    
    	

提交回复
热议问题