How to click the anchor using JQuery so that the href is also called?

JQuery handles the click event on anchor tags in a 'special' way. See this question for further information Can I call jquery click() to follow an link if I haven't bound an event handler to it with bind or click already?

JQuery handles the click event on anchor tags in a 'special' way. See this question for further information - Can I call jquery click() to follow an link if I haven't bound an event handler to it with bind or click already? From the question above - I did some research and it seems that the .

Click is not suppose to work with 'a' tags because the browser does not suport "fake clicking" with javascript. I mean, you can't "click" an element with javascript. With 'a' tags you can trigger its onClick event but the link won't change colors (to the visited link color, the default is purple in most browsers).

So it wouldn't make sense to make the $(). Click event work with 'a' tags since the act of going to the href attribute is not a part of the onClick event, but hardcoded in the browser.

It's not just JQuery, with DOM that would behave in the same way. – William Oct 18 at 16:20.

Change your "triggerHandler" to just "trigger" and see if that resolves your issue. I think triggerHandler bypasses the standard behavior and executes the "onclick" event handler in your case which is not set.

No difference; I had tried. – William Oct 18 at 12:38.

If (e. KeyCode == 13) { $('#anchorTest').click(); } Check from here jsfiddle.net/amBXV.

Does not trigger the href one... – Halil Özgür Oct 18 at 11:50 You can check from here jsfiddle. Net/amBXV – Sedat BaÅŸar Oct 18 at 11:53 No, it didn't say "inside anchorTest" when I hit Enter inside the text input. Chrome 14 – Halil Özgür Oct 18 at 11:59 try on firefox.. – Sedat BaÅŸar Oct 18 at 12:00 yeah, that just explains the problem not the solution.

– William Oct 18 at 12:39.

I cant really gove you an answer,but what I can give you is a way to a solution, that is you have to find the anglde that you relate to or peaks your interest. A good paper is one that people get drawn into because it reaches them ln some way.As for me WW11 to me, I think of the holocaust and the effect it had on the survivors, their families and those who stood by and did nothing until it was too late.

Related Questions