Friday, 7 August 2015

Play with Anchor tag attr

<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
    <title></title>
    <script src="https://ajax.googleapis.com/ajax/libs/jquery/1.11.3/jquery.min.js"></script>

    <script>
        $(document).ready(function () {
            $("#red").click(function () {
                window.location.reload();
            });

            $("a").attr("href", function (i, value) {
                return value.replace('RemoveURLtext', 'pagereturn');
                //return value.substring(0, value.indexOf("#"));
            });

        });
    </script>
</head>
<body>
    <form id="form1" runat="server">
    <div>
    <a href="http://localhost:1607/RemoveURLtext.aspx"> click me!!!</a>

        <br /> <br /> <br /> <br />
        <span id="red">Reload</span>
    </div>
    </form>
</body>
</html>

No comments:

Post a Comment