查看此 link .
我的问题是:当我点击链接时,我想要 .current div
在 <a>
链接(像这样 <a class="current">
) <a>
和 div <style>
将显示为 hover
.
请帮助我,在此先感谢。
最佳答案
jQuery:
$('a[id^="prod"]').removeClass("active");
$(this).addClass("active");
.active
类的 CSS:
a[id^="prod"].active {
background: #f7edda;
color: #d2ab67;
text-decoration: none;
}
关于jquery - 如何使用 jQuery 在 <li> 上添加当前 div?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/23970828/