I am working on a form and when you focus on an input field, I have a pop up that reminds them to save when they are complete. I only want the user to see this pop up once every 60 days. On focus I set a cookie that tells me they have seen the alert. Then however, since I only want this to appear every 60 days, I want to make sure it doesn't happen again next time they click. How do I execute something like, "if this cookie exists, then do this?" Below is a sample of the code I'm using:
$("input").focus(function(){
//My alert goes here (i'm good on this part")
Cookies.set('saveChanges', 'wasAlerted', { expires: 60, path: '/' });
//if SOMETHING, do SOMETHING ("need help here")
});
FYI, My cookie name is 'saveChanges' and the value is 'wasAlerted'.