0

I have a link on the page that i would like to disable when the page loads, when the user clicks on the radio button i would like to enable the link. How would i do so.

<a href="go.html" id="goTo">Add</a>

<input type="radio" id="enableLink" name="selection" onclick="">
Whitewall
  • 597
  • 1
  • 7
  • 18
Fadamie
  • 165
  • 1
  • 1
  • 11

2 Answers2

0
    <span id="add_link">Add</span>

    $('#enableLink').live('click', function() {
       $('#add_link').html('<a href="go.html" id="goTo">Add</a>');
    });
Nikhil Baliga
  • 1,339
  • 12
  • 18
0
$(function(){
    var isEnabled=false;    
    $("#goTo").click(function(e){
       if(!isEnabled)
       {
          e.preventDefault();
       }       
    });        
    $("#enableLink").click(function(){
        isEnabled=true;        
    });
});

Sample : http://jsfiddle.net/HyKL9/2/

Shyju
  • 214,206
  • 104
  • 411
  • 497