just a quick question, how do i tell jquery to action1 on first click, and when the user clicks again it should do action then restart actions?
ex: the user clicks like, the text should change to unlike, when the user presses unlike, it should change to like, and so on..
<a href="#" class="like">Like</a>
$('.like').click(function(){
//ajax
$(this).html('Remove like');
},function(){
$(this).html('like');
});
but it only seems to work once, like when the user have clicked it changes to remove like and when i click again nothing happends
Use the jquery toggle handler.
E.g.: