求指导代码那里有问题,运行不出来啊
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>挑战题</title>
<script src="https://libs.baidu.com/jquery/1.9.0/jquery.js" type="text/javascript"></script>
<style>
ul{margin: 0;padding: 0;}
li{list-style: none;}
input.text{padding-left: 4px;outline: none;}
</style>
</head>
<body>
<form action="#" method="get">
<input id="text" class="text" type="text" name="Username">
<input id="savebutton" type="button" value="savedata">
<input id="showbutton" type="button" value="showbutton">
</form>
<ul></ul>
<script>
var $txt=$("#text");
var json=[];
$("#savebutton").on("click",function(){
json.push{name:$txt.val()}
});
$("#showbutton").on("click",function(){
$.each(json,function(index){
$("ul").append("<li>"+json[index].name+"</li>")
}) ;
});
</script>
</body>
</html>