5)css("color","red"):设置前景色,即字体色
<table> <tr> <th>用户名</th> <th>密码</th> </tr> <tr> <td>张三</td> <td>123456</td> </tr> <tr> <td>李四</td> <td>654321</td> </tr> <tr> <td>王五</td> <td>162534</td> </tr> </table> <script type="text/javascript"> $("table tr:first").css("background-color","pink"); $("table tr:gt(0):odd").css("background-color","yellow"); $("table tr:gt(0):even").css("background-color","blue"); </script> 6)addClass("样式名")7)attr("checked","checked")
8)each(函数)
9)click(函数)
<input type="checkbox" value="篮球"/>篮球 <input type="checkbox" value="排球"/>排球 <input type="checkbox" value="羽毛球"/>羽毛球 <input type="checkbox" value="乒乓球"/>乒乓球 <input type="button" value="选中的个数"/> <input type="button" value="迭代显示选中的value"/> <script type="text/javascript"> $(":button:first").click(function(){ alert($(":checkbox:checked").size()) }); $(":button:last").click(function(){ $(":checkbox:checked").each(function(){ alert($(this).val()); }); }); </script>