I'm sorry, I really hate to be condescending. I understand there are a range of levels of JS expertise out there, and using either jQuery or an appropriate library represents real value for many.
However, when you're opening a comment with "Hell yeah, you do", I really have to respond.
Hell no, you don't. If you're writing 318 lines of code just to do a cookie warning, that's fine. But please don't preach that it's necessary before actually learning some javascript.
I'm also a bit baffled that it would take an entire 30 lines while using jQuery AND a cookie plugin. What are you doing to these cookies messages???
::EDIT::
I have no idea if the code below works, and it could do with a lot of improvement (thinking about secure cookies, cookie paths, or even just using localStorage instead), but I can't imagine a bit of testing and revision of the code would balloon it to even twice its size. Least of all 30 times its size.
(function() {
var cookiesMessage = document.getElementById('cookies-message-wrap');
var cookiesAccept = document.getElementById('cookies-accept-button');
var checkCookies = function () {
cookiesMessage.setAttribute('class', document.cookie.indexOf('cookiesaccepted=1')===-1?'':'accepted');
}
cookiesAccept .addEventListener('click', function() {
document.cookie = 'cookiesaccepted=1;expires=Tue, 19 Jan 2038 03:14:07 GMT;path=/';
checkCookies();
});
})();
What am I missing?