<input style="text-align:right" />
<input type="text" dir="rtl" />
这两个都是从右往左输入(反向输入),但文字排列顺序还是从左往右的(顺序排列).
另外还有反向输入反序排列

<!-- TWO STEPS TO INSTALL REVERSE TEXT WIZARD:

1. Copy the coding into the HEAD of your HTML document
2. Add the last code into the BODY of your HTML document -->

<!-- STEP ONE: Paste this code into the HEAD of your HTML document -->

<HEAD>

<!-- This script and many more are available free online at -->
<!-- The JavaScript Source!! http://javascript.internet.com -->
<!-- Original: David Hansen (b.o.b@compswizard.com) -->
<!-- Web Site: http://www.compswizard.com -->
<script language=javascript>

<!--

function reverseText(tName,fName) {
if (event.keyCode == 8) {
eval("document." + tName + "." + fName + ".value = ''");
}
if ((event.keyCode == 32) || ((event.keyCode >=48) && (event.keyCode <= 57)) || ((event.keyCode >= 65) && (event.keyCode <= 90)) || ((event.keyCode >= 186) && (event.keyCode <= 222))) {
text = "";
str = eval("document." + tName + "." + fName + ".value");
i = 0;
while (i <= (str.length - 1)) {
if (i == (str.length - 1)) {
text = str.substring(i, i+1) + text;
} else {
text += str.substring(i, i+1);
}
i++;
}
eval("document." + tName + "." + fName + ".value = text");
}
}

//-->

</script>

</HEAD>

<!-- STEP TWO: Copy this code into the BODY of your HTML document -->

<BODY>

<!-- This script and many more are available free online at -->
<!-- The JavaScript Source!! http://javascript.internet.com -->
<!-- Original: David Hansen (b.o.b@compswizard.com) -->
<!-- Web Site: http://www.compswizard.com -->
<form name=testForm action="" method=post>

<input name=testField type=text style="text-align:right" onKeyUp="reverseText('testForm','testField')">

</form>

<p><center>
<font face="arial, helvetica" size"-2">Free JavaScripts provided<br>
by <a href="http://javascriptsource.com">The JavaScript Source</a></font>
</center><p>

<!-- Script Size: 1.90 KB -->

最新文章

  1. java正则表达式【大全】
  2. 修改win7电脑中所有文件的默认查看方式
  3. HTML5属性运用
  4. 使用 archetype插件创建maven目录结构
  5. min_free_kbytes
  6. Real-Rime Rendering (2) - 变换和矩阵(Translation and Matrics)
  7. OpenCV——肤色检测
  8. SQL拼接方法
  9. 在浏览器里点击input输入框输入,会展示默认的历史下拉菜单
  10. 一次日语翻译的Chrome插件开发经历
  11. Imcash科普:没有网络也可以转账比特币?你可能有些误解
  12. #WEB安全基础 : HTTP协议 | 0x14 HTTP的详细安全问题
  13. 27.QT-QProgressBar动态实现多彩进度条(详解)
  14. Ubuntu: 软件库(software repositories)
  15. Hadoop 博文整理
  16. Pthon面向对象之基础
  17. 解决 插件LArea 在IOS上浮出软键盘问题
  18. bzoj4555(多项式求逆解法)
  19. JetBrains全系列破解
  20. Haskell语言练习

热门文章

  1. C++primer 练习11.33:实现你自己版本的单词转换程序
  2. nyoj 70 阶乘因式分解(二)
  3. 记事本源代码 python3
  4. JS浮点数运算BUG破法
  5. Weblogic发布小问题——The root element weblogic-web-app is missing in the descriptor file
  6. Java创建WebService服务及客户端实现
  7. ubuntu 开发环境搭建 lisp gcc python perl mysql
  8. Android 类库打包、发布方法
  9. android service 学习
  10. javascript设计模式-工厂模式