将用户输入的字符串反向输出到页面上,并且要求将其中的小写字母转换成大写字母。

将用户输入的字符串反向输出到页面上,并且要求将其中的小写字母转换成大写字母。

<script>
var str = prompt("脚本提示: 请输入一行文字:","");
var upper_str = str.toUpperCase();
for(var i=upper_str.length-1;i>=0;i--) document.write(upper_str.charAt(i));
</script>

原文地址:https://www.cnblogs.com/qinxuemei/p/4007031.html