0

I have table with td onclick event

<td id="ab2" onclick="popup('test')">Link</td>

I have disable onclick by calling

 $(#ab2").prop("onclick", null); 

Now i want to enable this link again when some one clicks on enable link below

<a href="#">Enable</a>

Thanks

2
  • What are you trying to do?? Commented Nov 27, 2013 at 7:19
  • @ Milind Anantwar onbody onload i have disable onclick now again one more link is there enable if anybody clicks on it onclick event will get enabled Commented Nov 27, 2013 at 7:21

2 Answers 2

1

Use this..

$("#ab2").unbind("click");

$( "#ab2" ).bind( "click", function() {
  alert( "User clicked" );
});
Sign up to request clarification or add additional context in comments.

Comments

1

use on and off in jQuery they work for it

for enable

$(#ab2").on("click"); 

for disble

$(#ab2").off("click"); 

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.