Take a look at the following code:
$(document).ready(function()
{
$('#link').click(function()
{
alert('1');
},
function()
{
alert('2');
});
});
Alert 2 will never happen! However I’m wanting to make a link do something different on it’s next click so like it’s an off and on switch. How do I do this in jQuery?
http://jsfiddle.net/GaL9P/