为什么我的代码按保存反而跳到慕课网了...??
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<script src="https://libs.baidu.com/jquery/1.9.0/jquery.js" type="text/javascript"></script>
<title>挑战题</title>
<style>
.table p
{
display:inline;
margin-right:10px;
}
#save_info,#show_info
{
margin-top:30px;
margin-left:30px;
}
</style>
</head>
<body>
<form action="#" method="get">
<div class="table">
<p>username:</p>
<input id="username" type="text" placeholder="请输入账号"/>
<br/>
<p>password:</p>
<input id="password" type="text" placeholder="请输入密码"/>
<br/>
<button id="save_info">Save</button>
<button id="show_info">Show</button>
</div>
<ul id="perform"></ul>
</form>
<script type="text/javascript">
var json = [];
$("save_info").on("click",function(){
json.push({
username:$("username").val();
password:$("password").val();
})
$("username").val('')
$("password").val('')
$("this").attr("disabled","true");
alert("save success");
});
$("show_info").on("click",function(){
$.each(json,function(index,person){
$("#perform").appendChild("<li>" + "username:" +json[index].username + "password:" + json[index].password + "</li>")
}
})
</script>
</body>
</html>