需要更進一步的功能就請自已處理了
<textarea name="input" rows="10" cols="100"><br>
<textarea name="output" rows="10" cols="100"></textarea>
<input type="button" value="go" onclick="go()">
<script>
function go(){
var inputText = document.getElementsByName("input")[0].value
var outputText = ""
var inputArray = inputText.split("\n")
for(var i=0;i<inputArray.length;i++){
var thisArray = inputArray[i].split(" ")
var leftArray = thisArray[0]
var rightArray = thisArray[1].split(",")
for(var j=0;j<rightArray.length;j++){
outputText += leftArray + " " + rightArray[j] + "\n"
}
}
document.getElementsByName("output")[0].value = outputText
}
</script>