JQuery Check if cookie exists

<script>
jQuery(document).ready(function ($) {
  // Function to check if a cookie exists
  function checkCookie(name) {
    return document.cookie.split(";").some(function (item) {
      return item.trim().indexOf(name + "=") == 0;
    });
  }

  // Check if the cookie exists
  if (checkCookie("parent_corner_show_content")) {
    // If the cookie exists, hide the section
      $("#parent_corner_form_section").hide();
      $("#parent_corner_contents_section").show();

  }
});
</script>

Leave a Reply

Your email address will not be published. Required fields are marked *