如何从文本中获取第二个值?例如 AB-10:1234。我希望函数显示 1234 而不是 10。
function myfunction(){
var txtNIM = document.getElementsByName("txtNIM")[0].value;
var somArr = txtNIM.split(String.fromCharCode(10));
[...]
}
<textarea name="txtNIM" cols="70" rows="9">
ABC-10: 1234
CBA-20: 4321
</textarea>