2013-02-14 89 views

回答

4

您可以使用CSS来做到这一点使用文本转换:大写;

2

试试这个

$('#buttonID').click(function() { 
    var upperString = $('#textAreaID').val().toUpperCase(); 
    $('#textAreaID').val(upperString); 
}); 

或者使用JavaScript

document.getElementById('buttonID').onclick = function() { 
    var uppperString = document.getElementById('textAreaID').value.toUpperCase(); 
    document.getElementById('textAreaID').value = upperString; 
} 
+0

优秀!这正是我需要的。我所尝试的一切都无法正常工作。非常感谢 – user2070685 2013-02-14 05:25:13

+0

欢迎:)如果这对你有帮助,那么你可以继续接受答案 – asifsid88 2013-02-14 05:42:35

0
$("#my_textarea").css({textTransform:"uppercase"}) 
相关问题