Yeungchiho
2018-10-26 21:07
<!DOCTYPE HTML>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<title>无标题文档</title>
<script type="text/javascript">
var mystr="86-010-85468578";
document.write( mystr.split("-") + "<br />");
document.write( mystr.split("") + "<br />");
document.write( mystr,split("",3) );
</script>
</head>
<body>
</body>
</html>
document.write( mystr,split("",3) );应改为document.write( mystr.split("",3) );
分割3次,limit要取数值为4
JavaScript进阶篇
468194 学习 · 21891 问题
相似问题