首页 > 其他 > 详细

temp

时间:2017-07-15 15:39:36      阅读:320      评论:0      收藏:0      [点我收藏+]

<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta name="content-type" content="text/html; charset=UTF-8">

<title>对话框测试</title>

<script>
var contacts = [
{
"firstName": "Akira",
"lastName": "Laine",
"number": "0543236543",
"likes": ["Pizza", "Coding", "Brownie Points"]
},
{
"firstName": "Harry",
"lastName": "Potter",
"number": "0994372684",
"likes": ["Hogwarts", "Magic", "Hagrid"]
},
{
"firstName": "Sherlock",
"lastName": "Holmes",
"number": "0487345643",
"likes": ["Intriguing Cases", "Violin"]
},
{
"firstName": "Kristian",
"lastName": "Vos",
"number": "unknown",
"likes": ["Javascript", "Gaming", "Foxes"]
}
];


function lookUp(firstName, prop){
// 请把你的代码写在这条注释以下
for(var i=0;i<contacts.length;i++){
if(contacts[i].firstName == firstName ){

}
}

// 请把你的代码写在这条注释以上
}

// 你可以修改这一行来测试你的代码


</script>
</head>

<body>

对话框测试:

<div style="margin-top:50px">
<input type="button" value="alert" onclick=‘lookUp("Akira", "likes")‘ />
<input type="button" value="alert" onclick=‘lookUp("Kristian", "lastName")‘ />
<input type="button" value="alert" onclick=‘lookUp("Sherlock", "likes")‘ />
<input type="button" value="alert" onclick=‘lookUp("Bob", "number")‘ />
<input type="button" value="alert" onclick=‘lookUp("Akira", "address")‘ />
</div>
</body>
</html>

temp

原文:http://www.cnblogs.com/lwmp/p/7182749.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!