»
EnglishFrenchVietnamese

Print - Backwards Text 2.0 - JavaScriptBank.com

Full version: jsB@nk » Text » Backwards Text 2.0
URL: https://www.javascriptbank.com/backwards-text-2-index.html

Backwards Text 2.0 © JavaScriptBank.comA script that makes any text you typed display backwards.

Full version: jsB@nk » Text » Backwards Text 2.0
URL: https://www.javascriptbank.com/backwards-text-2-index.html



JavaScript
<SCRIPT language=javascript>function back(){var thestring="";var yt="<h3>Your Text</h3>";var text = document.forms[0].elements[0].value;var filter = new RegExp('([\\f\\n\\r\\t\\v ])+', 'gi');var data = text.replace(filter," ");data = data.replace(/</gi,"").replace(/>/gi,"");for (var i=data.length-1;i>=0;i--) {thestring+=data.charAt(i);}document.getElementById("where").innerHTML=yt;document.getElementById("where").innerHTML+=thestring;}function res() {var ask="Do you want to clear the text box?";if (confirm(ask)) document.forms[0].elements[0].value="";}</SCRIPT><!--    This script downloaded from www.JavaScriptBank.com    Come to view and download over 2000+ free javascript at www.JavaScriptBank.com-->


HTML
<DIV id=intro>Type text into the box and click &#39;Convert&#39; to make it appear backwards! </DIV><H3>The Rundown</H3>This script will make the text you type in the box appear backwards. Try it.<BR><FORM onsubmit="back(); return false;"><TEXTAREA rows=6 cols=40>Type text here</TEXTAREA><BR><BUTTON onclick=back()>Convert!</BUTTON>&nbsp;<BUTTON onclick=res()>Clear Text</BUTTON> </FORM><DIV id=where></DIV><!--    This script downloaded from www.JavaScriptBank.com    Come to view and download over 2000+ free javascript at www.JavaScriptBank.com-->