如何使文本字段中的所有内容都是大写字母/大写? [英] How to make everything in a textfield be capital letters / uppercase?

查看:137
本文介绍了如何使文本字段中的所有内容都是大写字母/大写?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想把我在文本字段中写的所有内容写成大写字母。我写的,而不是在失去焦点后。



我如何使用jQuery来做这件事?

解决方案



只需将文本转换:大写添加到您的样式,然后在服务器端,您可以将其转换为大写。

  input {
text-transform:大写;
}


I want to make everything I write in a textfield to be capital letters. As I write, not after losing focus.

How do I do this using jQuery?

解决方案

I would use CSS for this.

Just add text-transform: uppercase to your styling, and then on the server side you can convert it to uppercase.

input {
  text-transform: uppercase;
}

这篇关于如何使文本字段中的所有内容都是大写字母/大写?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆