<script language = "javascript ">
var a = "abcdefg ";
for(.....){
alert(......);
}
</script>
帮我写个脚本,将a里的每个元素都alert一次
------解决方案--------------------
<script language = "javascript ">
var a = "abcdefg ";
for(int i=0;i <a.length;i++){
alert(a.charAt(i));
}
</script>
------解决方案--------------------
楼上正解
------解决方案--------------------
楼上的完全正确
------解决方案--------------------
<script language = "javascript ">
var a = "abcdefg ";
for(int i=a.length-1;i> 0;i--){
alert(a.charAt(i));
}
</script>
------解决方案--------------------
...
------解决方案--------------------
.....