Hi all, I have an input button with an img source and I have named the class to MyBtn. What I trying to do is to prevent more that one click at a button, and this is a dynamic page so it could be more than one button (like a gridview). It works but I would like to add a cookie as well, I using the jquery.cookie plugin. My idea is to replace the button image with another image once it have been clicked.
Would be great if someone have an idea about how to deal with a cookie here.
$(".MyBtn").click(function(event){
event.preventDefault();
$.cookie('MyCookie', 'Clicked');
var ClickFunction = $.cookie('MyCookie');
if (ClickFunction == 'Clicked') {
$(this).replaceWith("<img src='/Clicked.png' />");
};
});