Reputation: 7451
How to activate and deactivate the Rails code hyperlink using JQuery for the following code:
<%= f.add_associated_link "Add another email address",:class => 'add' %>
Upvotes: 0
Views: 379
Reputation: 16287
Do you want to hide/show the link? If so, you can use toggle.
$('a.add').toggle();
There's also hide()
and show()
.
Upvotes: 1
Reputation: 108
Well, I you want to deactivate you could do something like
var activated = false;
$(".className").click(function(e){
if(!activated){
e.preventDefault();
}
}
But you might wanna be a bit more specific about what you want to do.
Upvotes: 1