当用户开始在jquery中输入文本时,如何使TEXTBOX中的文本变为大写字母 [英] How do make the text in the TEXTBOX to Capital letter when the user starts typing text in jquery

查看:55
本文介绍了当用户开始在jquery中输入文本时,如何使TEXTBOX中的文本变为大写字母的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

当用户开始在文本框中输入文本时,我们需要将这些字母转换为大写字母

when the user starts typing the text in to the text box we need to make those letters to capital letters

推荐答案

编辑:请参阅奇格利的答案.

See chigley's answer instead.

$(function() {
    $('#myTextBox').keyup(function() {
        $(this).val($(this).val().toUpperCase());
    });
});

演示: http://jsfiddle.net/SMrMQ/

或者,使用CSS设置样式并在后端进行实际转换.

Alternately, style with CSS and do actual conversion on your back-end.

这篇关于当用户开始在jquery中输入文本时,如何使TEXTBOX中的文本变为大写字母的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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