Simple memory in jQuery or Javascript Vanilla (yeah two version!)