标签:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> <html lang="en"> <head> <meta http-equiv="Content-Type" content="text/html;charset=UTF-8"> <title>Document</title> <script> window.onload = function(){ var country = { name: "中国", provinces: [ { name: "黑龙江", citys: { city: ["哈尔滨", "大庆"]} }, { name: "广东", citys: { city: ["广州", "深圳", "珠海"]} }, { name: "台湾", citys: { city: ["台北", "高雄"]} }, { name: "新疆", citys: { city: ["乌鲁木齐"]} } ] } // document.write(country.name);//中国 // document.write(country.provinces[0].name);//黑龙江 document.write(country.provinces[2].citys.city[0]);//台北 } </script> </head> <body> </body> </html>
标签:
原文地址:http://www.cnblogs.com/bybelief/p/5213991.html