<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="login.aspx.cs" Inherits="JQuery.login" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
<title>JQuery學習</title>
<script src="Scripts/jquery-1.7.2.min.js" type="text/javascript"></script>
<script type="text/javascript">
// 窗體加載
// $(document).ready(function ()
// { alert("Hello, world."); });
$(function () {
$("#Button1").click(function () {
$("p").hide();
});
});
</script>
</head>
<body>
<h2>This is a heading</h2>
<p>This is a paragraph.</p>
<p>This is another paragraph.</p>
<form id="form1" runat="server">
<div>
<asp:Button ID="Button1" runat="server" Text="Button" />
</div>
</form>
</body>
</html>
為什麼隱藏過後會馬上還原,要想讓他一直隱藏沒怎麼寫,初學著,求解
asp:Button對應客戶端submit按鈕,要return false阻止表單提交
$("#Button1").click(function () {
$("p").hide();
return false///
});