添加链接
link管理
链接快照平台
  • 输入网页链接,自动生成快照
  • 标签化管理网页链接

Select the first row in a table $("tr:first") in jQuery

Description

The following code shows how to select the first row in a table $("tr:first").

Example


<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.11.1/jquery.min.js"></script>
<script type="text/javascript">
$(document).ready(function(){<!--from  w ww  . j  a  v  a  2s. co m-->
$("tr:first").css("font-style", "italic");
</script>
</head>
<table>
<tr><td>Row 1</td></tr>
<tr><td>Row 2</td></tr>
<tr><td>Row 3</td></tr>
</table>
</body>