首页 > 代码库 > javaScript基础核心(1)

javaScript基础核心(1)

 1 /* 2 var a = [1,2,3]; 3 for(var each in a){ 4     document.write(each+":" + a[each]+‘<br />‘) 5 } 6 结果: 7     0:1 8     1:2 9     2:310 */


11 /*with语句实例:12 frames[1].document.forms[0].name.value = http://www.mamicode.com/‘‘;>13 frames[1].document.forms[0].address.value = http://www.mamicode.com/‘‘;>14 frames[1].document.forms[0].email.value = http://www.mamicode.com/‘‘;>15 16 可以写成下面with语句:17 with(frames[1].document.forms[0]){18 name.value = http://www.mamicode.com/‘‘;>19 address.value = http://www.mamicode.com/‘‘;>20 email.value = http://www.mamicode.com/‘‘;>21 }22 */

 

javaScript基础核心(1)