Answer the question
In order to leave comments, you need to log in
jQuery or JavaScript: How to check if a user has clicked on an anchor link?
I wish you good health, habrovtsy!
I've climbed the whole net, but I couldn't even form a normal question for the search :). So the question is:
I have a bookmark link,
I need it so that when the user clicks on this link, an event is called for jquery or javascript. For example:
I have a link in the code as above. I sent a link to the user's mail
preloaders.net/ru/3d/#mylink
And when the user follows this link, in my jquery I want to do something like
$(document).ready(function(){<br/>
<br/>
$('.myclass').click(function(){<br/>
alert($(this).attr('name'));<br/>
});<br/>
<br/>
});<br/>
Answer the question
In order to leave comments, you need to log in
If I understand you correctly, then:
$(document).ready(function(){
if (document.location.hash=='#mylink'){
alert();
}
});
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question