字符串对象的 split() 方法
<script type="text/javascript"> var sentence = "the quick brown fox jumped over the lazy dog"; var words = sentence.split(" "); for ( var i = 0; i < words.length; ++i) { document.write("word " + i + ": " + words[i]+"<br />"); } </script>