1

I have been thinking about this for a while and didn't come up with anything by myself - So I was wondering if any of you had a clean idea on how to do it.

If a word were to be put into a textbox on a form and then submitted, I wondered if there could be some javascript which would break down the word into each letter, example:

"Eye" to "E" "y" "e"

is this possible? could you spare some code? ^^

4

1 回答 1

3
var s = "Eye";
alert(s.split(''));

.split is normally used with a delimiter to split the string on, but if you pass an empty string in its place, it splits at every character.

Here's a fiddle.

于 2013-09-22T15:47:47.470 回答