I have an input text field like this,
http://jsfiddle.net/DerekL/Y8ySy/
$("body").prop("contentEditable", true).blur(function(){
var chars = $(this).text().split("");
this.innerHTML = "";
$.each(chars, function(){
$("").text(this).css({
color: "#"+(Math.random()*16777215|0).toString(16) //just some random color
}).appendTo("body");
});
});
You can actually set the event to keypress if the user is only going to enter with a normal keyboard. I used blur here because keypress/keyup will break the code if the user is entering text with IME.
As Billy Mathews mentioned, one might want to have an input that can be submitted by form. Here is a solution:
var chars = $(this).text().split("");
$("#hiddenEle").val($(this).text());
this.innerHTML = "";
Here is one that won't change color: http://jsfiddle.net/DerekL/A7gL2/