Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to enable a hyperlink?

There are 2 radiobutton and a hyperlink. if select 'radiobutton1' the hyperlink is enabled. if select 'radiobutton2' the hyperlink is disabled. i can use jquery to disable the hyperlink, but can't enable it. How to enable the hyperlink with jquery?


1 Answers

You could try adding a click event handler and return true or false from the click handler based on the state of the radio buttons.

Returning false should cancel the click on the link, something like:

$("#hyperlink1").click(function(){                      
    // return true or false based on your radio buttons  
    return enableLink;                  
});
like image 130
seanb Avatar answered May 16 '26 08:05

seanb



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!