I have 2 hyperlinks. when i click on one hyperlink the another hyperlink should be disabled means it should be seen but not clicked by any user
Please help me
<a href="">hiii </a>
<a id="check" href="google.com">bye</a>
in JavaScript
$('#check').attr('disabled', true);
but it is not working
Using java script you can disable the hyper link by adding a .disabled class as seen below:
.inactive //add this class to the link if you want to disable it
{
pointer-events: none;// this will disable the link
cursor:default;
}
then use .inactive class in appropriate line...
Try below
$('.my-link').click(function () {return false;});
To re-enable it again, unbind the handler:
$('.my-link').unbind('click');
or
$('.my-link').attr('disabled', 'disabled');
Use this to re-enable it:
$('.my-link').attr('disabled', '');
Thanks,
Siva
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With