Javascript .toUpperCase()按钮将文本区域中的所有文本大写

Javascript .toUpperCase()按钮将文本区域中的所有文本大写,javascript,textarea,capitalize,Javascript,Textarea,Capitalize,我需要做什么才能有一个按钮来点击将文本区域中的所有文本转换为大写字母?不只是第一个字母,而是每一个字母 非常感谢您的帮助您可以使用css来实现这一点,使用文本转换:大写 您可以使用css来实现这一点,使用文本转换:大写 试试这个 $('#buttonID').click(function() { var upperString = $('#textAreaID').val().toUpperCase(); $('#textAreaID').val(upperString); });

我需要做什么才能有一个按钮来点击将文本区域中的所有文本转换为大写字母?不只是第一个字母,而是每一个字母


非常感谢您的帮助

您可以使用css来实现这一点,使用文本转换:大写

您可以使用css来实现这一点,使用文本转换:大写

试试这个

$('#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;
}
试试这个

$('#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;
}

你试过什么吗?
toUpperCase
大写字母每个字母你试过什么吗?
toUpperCase
大写字母每个字母非常棒!这正是我需要的。我所尝试的一切都不会正常工作。非常感谢。如果这对你有帮助的话,你可以继续接受答案。太好了!这正是我需要的。我所尝试的一切都不会正常工作。非常感谢。如果这对你有帮助,你可以继续接受答案