2
I need to create a Javascript function that is called when clicking a button and must cancel the click of a tag <a>
.
I tried this way:
$("#botao").click(function(){
$("a").unbind('click')
})
But when you click on the tag it keeps sending to the link of your href attribute. I’ve also tried with .off('click')
, but also without success.
After canceling the click I need to be able to return with the click event.
And remove the href by clicking the button, can not be?
– LocalHost
No because you may need to use this link later. I have to have the possibility to cancel and return the click event
– Felipe Coelho
The jQuery has the
.one(
which only runs once, but I don’t know if that’s what you’re looking for because the question is unclear. You can explain better, show some HTML and give examples of actions and what you expect to happen?– Sergio