If you want to create an application like fliptext.org then you can do this using given javascript function.Using this application anyone can copy the output and use it on Facebook ,Twitter and MySpace .Follow these steps to develop an application like fliptext.
1.Copy the given code and save as script.js.
function flipmytext() { var str=document.getElementById('txt').value; var result = flipmyString(str); document.getElementById('res').value = result; } function flipmyString(aString) { aString = aString.toLowerCase(); var last = aString.length - 1; var result = ""; for (var i = last; i >= 0; --i) { result += flipmyChar(aString.charAt(i)) } return result; } function flipmyChar(c) { if (c == 'a') { return 'u0250' } else if (c == 'b') { return 'q' } else if (c == 'c') { return 'u0254' } else if (c == 'd') { return 'p' } else if (c == 'e') { return 'u01DD' } else if (c == 'f') { return 'u025F' } else if (c == 'g') { return 'b' } else if (c == 'h') { return 'u0265' } else if (c == 'i') { return 'u0131'//'u0131u0323' } else if (c == 'j') { return 'u0638' } else if (c == 'k') { return 'u029E' } else if (c == 'l') { return 'u05DF' } else if (c == 'm') { return 'u026F' } else if (c == 'n') { return 'u' } else if (c == 'o') { return 'o' } else if (c == 'p') { return 'd' } else if (c == 'q') { return 'b' } else if (c == 'r') { return 'u0279' } else if (c == 's') { return 's' } else if (c == 't') { return 'u0287' } else if (c == 'u') { return 'n' } else if (c == 'v') { return 'u028C' } else if (c == 'w') { return 'u028D' } else if (c == 'x') { return 'x' } else if (c == 'y') { return 'u028E' } else if (c == 'z') { return 'z' } else if (c == '[') { return ']' } else if (c == ']') { return '[' } else if (c == '(') { return ')' } else if (c == ')') { return '(' } else if (c == '{') { return '}' } else if (c == '}') { return '{' } else if (c == '?') { return 'u00BF' } else if (c == 'u00BF') { return '?' } else if (c == '!') { return 'u00A1' } else if (c == "'") { return ',' } else if (c == ',') { return "'" } else if (c == '.') { return 'u02D9' } else if (c == '_') { return 'u203E' } else if (c == ';') { return 'u061B' } else if (c == '9') { return '6' } else if (c == '6') { return '9' } return c; }
2.Copy the following HTML code and save as flip.html. Please note that script.js and flip.html should be in same folder.
<html> <head> <script type="text/javascript" src="script.js"> </script> <title>Write text UpsideDown</title> </head> <body> <form> Write Your Text Here :<br/> <textarea rows="8" name="txt" id="txt" onKeyUp="javascript:flipmytext();"> </textarea> <input type="button" value="Flip Text" onClick="javascript:flipmytext();" /> </form> <form> Your UPside Down Text is here :<br /><textarea rows="8" name="res" id="res"> </textarea> </form> </body> </html>
Example-
input-flip
output-dıןɟ
The post How to write text upside down Flip Text using Java Script appeared first on .