麻烦哪位好心人帮忙看看,为什么我的就是不行
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<script src="http://labs.baidu.com/jquery/1.9.0/jquery.js" type="text/javascript"></script>
<title>挑战题</title>
</head>
<body>
<form>
<input id="text1" type="text" name="name" value="姓名"><br>
<input id="text2" type="text" name="idnum" value="学号"><br>
<input id="sub1" type="button" value="提交信息">
<input id="sub2" type="button" value="显示信息">
</form>
<ul></ul>
<script>
var $text1=$("#text1");
var $text2=$("#text2");
var json=[];
$("#sub1").click(function(){
json.push({
"name" : $text1.val(),
"idnum": $text2.val()
});
$text1.val('');
$text2.val('');
});
$("#sub2").click(function(){
$.each(json,function(i){
$("ul").append('<li><b>'+ json[i].name + '</b>:<b>' + json[i].idnum + '</b></li>');
});
});
</script>
</body>
</html>