<!DOCTYPE html><html> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <script src="http://libs.baidu.com/jquery/1.9.0/jquery.js" type="text/javascript"></script> <title>挑战题</title> </head> <body> <button id="seach">查询成绩</button></br> <div></div> <script> $(function(){ var json=[ {"name":"小明","score":"70"}, {"name":"小红","score":"80"}, {"name":"小蓝","score":"50"}, {"name":"小白","score":"20"} ]; $("#seach").bind("click",function(){ $("div").empty(); $.each(json,function(index,data){ $("div").append("<p>姓名:" + data.name + ",成绩:" + data.score + "</p>") }) }) }) </script> </body></html>
添加回答
举报
0/150
提交
取消