我想使用JavaScript在用户输入时将小写字母转换为大写。欢迎任何建议。
我尝试了以下方法:
$("#textbox").live('keypress', function (e) { if (e.which >= 97 && e.which <= 122) { var newKey = e.which - 32; // 我尝试设置这些 e.keyCode = newKey; e.charCode = newKey; } });
用户名或电子邮箱地址
密码