码迷,mamicode.com
首页 > Web开发 > 详细

web -- JS代码库

时间:2015-11-10 16:04:02      阅读:160      评论:0      收藏:0      [点我收藏+]

标签:

1. Javascript对象

function myFun(){
    var x;
    var txt = "";
    var person = {fname:"Bill", lname:"Gate", age:56}
    for (x in person){
        txt = txt + person[x] + " ";
     }
     document.getElementById("demo").innerHTML = txt;
}

2. break

cars=["BMW","Volvo","Saab","Ford"];
list:{
document.write(cars[0] + "<br>");
document.write(cars[1] + "<br>");
document.write(cars[2] + "<br>");
break list;
document.write(cars[3] + "<br>");
document.write(cars[4] + "<br>");
document.write(cars[5] + "<br>");
}

web -- JS代码库

标签:

原文地址:http://www.cnblogs.com/lianfu/p/4952936.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!