jq之$(“tr:odd“).css(“background-color“,“red“);
生活随笔
收集整理的这篇文章主要介绍了
jq之$(“tr:odd“).css(“background-color“,“red“);
小编觉得挺不错的,现在分享给大家,帮大家做个参考.
<!DOCTYPE html>
<html lang="en">
<head><meta charset="UTF-8"><title>jq之demo</title><!--线上jq库--><script src="https://code.jquery.com/jquery-3.4.1.min.js"></script><script>$(document).ready(function(){$("button").click(function(){/*$("tr:odd")奇数位置的tr元素*/$("tr:odd").css("background-color","red");});});</script>
</head>
<body>
<h1>主页</h1>
<table border="1"><tr><th>网站名</th><th>网址</th></tr><tr><td>百度</td><td>https://www.baidu.com/?tn=40020637_4_oem_dg</td></tr><tr><td>b站</td><td>https://www.bilibili.com/</td></tr><tr><td>csdn</td><td><a href="https://blog.csdn.net/wanggang182007">无名csdn</a></td></tr><tr><td>github</td><td>https://github.com/trending/java?since=monthly</td></tr><tr><td>gitee</td><td>https://search.gitee.com/?skin=rec&type=repository&q=%E7%94%B5%E5%95%86</td></tr>
</table>
<button>点我<button/>
</body>
</html>
总结
以上是生活随笔为你收集整理的jq之$(“tr:odd“).css(“background-color“,“red“);的全部内容,希望文章能够帮你解决所遇到的问题。
- 上一篇: PWN题[强网先锋]orw超详细讲解(多
- 下一篇: Tcp实现聊天讲解