String effects using JavaScript arrays.

If you are interested in the code, View Source (Ctrl+u).

Input text here:

characters left out of 250
 
Read typed text here:

 
Read reversed characters here:

 
Read reversed words here:


How it works:

function reversechars: The split function divides the string between the characters and puts the individual characters into a Javascript array. An array is a list, and it can be sorted, so the next command reverses the order, then the join command turns the reversed array of characters back into a string.

function reversewords: The split function divides the string into words on the space character and puts the individual words into a Javascript array. An array is a list, and it can be sorted, so the next command reverses the order, then the join command turns the reversed array of words back into a string while adding spaces between words.

Word count function: This function is called by every keypress in the Input textbox. The fuction counts the number of characters already entered in the textbox, then subtracts them from the maxlimit value that the function is called with.


The code on this page is partly original and partly derivative. For all practical puposes it is in the public domain.