JQuery 入門執行個體1_jquery

來源:互聯網
上載者:User
複製代碼 代碼如下:

<%@ Page Language="C#" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<script runat="server"></script>

<html xmlns="http://www.w3.org/1999/xhtml" >
<head runat="server">
<title>無標題頁</title>
<script src="../jquery指令碼/jquery-1[1].3.2.min.js" src="jquery指令碼/jquery-1[1].3.2.min.js" type="text/javascript"></script>
<script type="text/javascript"><!--
$(document).ready(function(){
$("tr").each(function(){
$(this).children("td:not(:first,:last)").each(function(){
$(this).css('color','blue');
});
});
});

// --></script>
</head>
<body>
<form id="form1" runat="server">
<div>
<table>
<tr>
<td>1</td>
<td>2</td>
<td>3</td>
<td>4</td>
</tr>
<tr>
<td>1</td>
<td>2</td>
<td>3</td>
<td>4</td>
</tr>
</table>

</div>
</form>
</body>
</html>

PS:
$(document).ready()由於應用情境眾多,所以可以直接用$(fn)來代替,fn表示處理函數。(ready處理函數貌似在文檔內容載入完成後執行,無需等待相關其它圖片等資源載入完成,所以比load事件要更早執行,對於這點,沒有具體證實)$(document).ready()由於應用情境眾多,所以可以直接用$(fn)來代替,fn表示處理函數。(ready處理函數貌似在文檔內容載入完成後執行,無需等待相關其它圖片等資源載入完成,所以比load事件要更早執行,對於這點,沒有具體證實)

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.