<a> tag doesn&#39;t navigate

时间:2016-03-13 18:49:30

标签: jquery asp.net-mvc twitter-bootstrap-3

I have anchor tag, i wanted to be hidden when clicked, i found a solution online however when i click am not redirected to the target URL?

and is there a way to replace with loading, searching in this site i could find many to replace button but not anchor tag

<a id="startClick" class="btn btn-start animated fadeInUpBig" href="@Url.Action("Index", "Home",new{id=0})">Start now</a>

script

$(function () {
    $("#startClick").click(function () {
        $(this).hide();
        return false;
    });
});

2 个答案:

答案 0 :(得分:3)

从点击事件中删除return false。它会阻止链接的导航。

$("#startClick").click(function () {
    $(this).hide();
});

答案 1 :(得分:2)

在点击事件中返回false将停止导航。如果删除它,浏览器会将您带到URL。