jquery 查找活动 div
大家好,
我有简单的 html 代码显示表格宽度
html,
<table class="table_site">
<tr>
<td class="subsite"><a href="#">register</a></td>
<td class="subsite"><a href="#">login</a></td>
<td class="subsite"><a href="#">home</a></td>
<td class="subsite"><a href="#">market</a></td>
<td class="subsite"><a href="#">mail</a></td>
</tr>
</table>
现在我有一些脚本,
$(function() {
$('.subsite')
.click(function(){
$('.content').empty()
document.title = '..:: DIELECSUR S.L ::' + $current;
loadContent($current"_main.html")
$(this).css("text-decoration", "underline")
});
});
我真正的问题是: 我如何使用最短的代码来找到 td.subsite 类的正确内容,当单击它时,并用作变量值以在有效的 url 加载中附加文本转换???
hy everyone,
i have simple html code showing a table width
html
<table class="table_site">
<tr>
<td class="subsite"><a href="#">register</a></td>
<td class="subsite"><a href="#">login</a></td>
<td class="subsite"><a href="#">home</a></td>
<td class="subsite"><a href="#">market</a></td>
<td class="subsite"><a href="#">mail</a></td>
</tr>
</table>
now i´ve got some script
$(function() {
$('.subsite')
.click(function(){
$('.content').empty()
document.title = '..:: DIELECSUR S.L ::' + $current;
loadContent($current"_main.html")
$(this).css("text-decoration", "underline")
});
});
my real question is:
how can i use le shortest code to find the proper content of td.subsite class that when click on it, and use as a variable value to append text converting in a valid url lo load???
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
如果您想要做的是从单击的链接获取文本并在 jQuery 中使用它,您可以这样做:
If what you're trying to do is get the text from the link that was clicked on and use it in your jQuery, you can do that like this:
试试这个。
Try this.