我有一些值存储在数组中,我想拆分它们并且想知道它包含值的长度但是当我运行函数时它不起作用
<head>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript">
$(function(){
var valData= ['songs','video','movie','games','other'];
var valNew=valData.split(',');
for(i=0;i<valNew.length;i++);
alert(valNew.length)
})
</script>
</head>
<body>
<select id="me"></select>
</body>