将用户输入的字符串反向输出到页面上,并且要求将其中的小写字母转换成大写字母。
<script>
var str = prompt("脚本提示:\n 请输入一行文字:","");var upper_str = str.toUpperCase();for(var i=upper_str.length-1;i>=0;i--) document.write(upper_str.charAt(i));</script>本文共 262 字,大约阅读时间需要 1 分钟。
将用户输入的字符串反向输出到页面上,并且要求将其中的小写字母转换成大写字母。
<script>
var str = prompt("脚本提示:\n 请输入一行文字:","");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