小编But*_*her的帖子

使用javascript将用户类型转换为大写

当用户使用javascript键入时,我想将小写字母转换为大写.欢迎任何建议.

我尝试过以下方法:

$("#textbox").live('keypress', function (e) {
    if (e.which >= 97 && e.which <= 122) {
        var newKey = e.which - 32;
        // I have tried setting those
        e.keyCode = newKey;
        e.charCode = newKey;
    }
});
Run Code Online (Sandbox Code Playgroud)

javascript jquery keycode uppercase

37
推荐指数
4
解决办法
9万
查看次数

标签 统计

javascript ×1

jquery ×1

keycode ×1

uppercase ×1