The hyperlink needs two clicks to execute a javascript function

lawrenceshrew

New Member
I have a hyperlink and i want to execute a function on the click event of that hyperlink.The function itself works but the problem is I need two clicks to execute the function.I tried to google but didnt get anything which works. would be nice if anyone can point out the mistake i am doing...:)\[code\]$("#btn_logout").click(function () { logout(); });\[/code\]and this is the link\[code\]<a href="http://stackoverflow.com/questions/12744312/#" id="btn_logout">[Log off]</a>\[/code\]
 
Back
Top