You must Sign In to post a response.
  • Category: JQuery

    Disable anchor should not get clicked ( it should disabled)

    hi ,

    I have below table strucure

    <table>
    <tr>
    <td><a href="#"><label id="manual_attnd">Manual Attendance</label></a></td>
    </tr>
    <tr>
    <td><a href="#"><label id="view_attnd"></label>View</a></td>
    </tr>

    <tr>
    <td><a href="#"><label id="edit_attnd"></label>Edit</a></td>
    </tr>

    </table>

    I want label 'Manual Attendance' to be disabled , means anchor tag should not get clicked on load.

    Thanks .
  • #769915
    Dear Ayesha,

    It can be disabled through front-end also. Find the attached modified code of yours.

    <!DOCTYPE html>

    <html xmlns="http://www.w3.org/1999/xhtml">
    <head runat="server">
    <title></title>
    <style type="text/css">
    a.disabled {
    pointer-events: none;
    cursor: default;
    }
    </style>
    </head>
    <body>
    <form id="form1" runat="server">
    <div>
    <table>
    <tr>
    <td><a href="https://www.google.com/" class="disabled"><label id="manual_attnd">Manual Attendance</label></a></td>
    </tr>
    <tr>
    <td><a href="https://www.google.com/"><label id="view_attnd"></label>View</a></td>
    </tr>
    <tr>
    <td><a href="https://www.google.com/"><label id="edit_attnd"></label>Edit</a></td>
    </tr>
    </table>
    </div>
    </form>
    </body>
    </html>

    Hope this will help you.

    Regards,
    Nirav Lalan
    DNS Gold Member
    "Failure is the path of least persistence"


  • Sign In to post your comments