每个页面的列表菜单下划线

时间:2013-06-10 06:32:54

标签: css paging underline

<ul>
<li><a href="/product/list.html?cate_no=1">menu 1</a></li>
<li><a href="/product/list.html?cate_no=2">menu 2</a></li>
<li><a href="/product/list.html?cate_no=3">menu 3</a></li>
</ul>

使用jquery, 如果我点击菜单1,我想在列表“菜单1”上下划线。 如果单击菜单2,则仅在“菜单2”上显示下划线。

请帮助!

1 个答案:

答案 0 :(得分:0)

CSS:

a {
    text-decoration: none;
}

jQuery的:

$("a").on( "click", function(event) {
    event.preventDefault();
    $("a").css( "text-decoration", "none" );
    $(this).css( "text-decoration", "underline" );
});