JQuery 分割字符串
JQuery 分割字符串
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>菜鸟教程(runoob.com)</title>
<script src="https://cdn.staticfile.org/jquery/2.0.0/jquery.min.js">
</script>
<script>
$(document).ready(function(){
$("button").click(function(){
var arr = \'google,stackoverflow,JavaWorld\';
var strArray = arr.split(\',\');
for(var i in strArray){
alert(strArray[i]);
}
});
});
</script>
</head>
<body>
<h3></h3>
<button>点我</button>
</body>
</html>
菜鸟教程在线测试网址: