Ok, so...i've a button with onclick.
<input id='post-favorite' onclick='Post.Favorite(15,"set");' type='submit' value='Favorite'>
but i need to change the onclick value when it's clicked to Post.Favorite(15,"unset");
there is a way to do that?
Because i've read in some places that is inpossible, intead use onclick use jquery click event.
But the problem is...if i use click event how do i send the values to the event or change them simulating the change of the onclick
?
Also the button is generated by php. If the user already has favorited the image if displays "unset" in the onclick, and if not favorited displays "set" to then when the user do the click set or not the image.