Enable and Disable Links using only CSS

All you need to add is pointer-events property to the css class desired. None will not allow the link to fire, while auto or inherit would open the link:

<style>

a.disabled { pointer-events: none; }

a.enabled { pointer-events: auto; }

</style>

<a href=”https://rochcass.wordpress.com&#8221; class=”enabled” target=”_blank”> Enabled Link </a>
<a href=”https://rochcass.wordpress.com&#8221; class=”disabled” target=”_blank> Disabled Link </a>

Manage Cookies in JavaScript

function setCookie(cookie_name, cookie_value, cookie_days) {

var expiry_date = new Date();

expiry_date.setDate(expiry_date.getDate() + cookie_days);

var cookie_value = escape(cookie_value) + ((expiry_date == null) ? “” : “; expires=” + expiry_date.toUTCString());

document.cookie = cookie_name + “=” + cookie_value;

}

function getCookie(cookie_name) {

var cookie_value = document.cookie;

var cookie_value_start = cookie_value.indexOf(” ” + cookie_name + “=”);

if (cookie_value_start == -1)

cookie_value_start = cookie_value.indexOf(cookie_name + “=”);

if (cookie_value_start == -1)

cookie_value = null;

else {

cookie_value_start = cookie_value.indexOf(“=”, cookie_value_start) + 1;

var cookie_value_end = cookie_value.indexOf(“;”, cookie_value_start);

if (cookie_value_end == -1)

cookie_value_end = cookie_value.length;

cookie_value = unescape(cookie_value.substring(cookie_value_start, cookie_value_end));

}
return cookie_value;

}

function deleteCookie(cookie_name) {

document.cookie = cookie_name + ‘=;expires=Mon, 01 Jan 1990 00:00:01 GMT;’;

};

 

function checkCookieExists(cookie_name) {

if(getCookie(cookie_name) == null)

return false;

else

return true;

};