Hi nauna,
Check this example. Now please take its reference and correct your code.
HTML
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.2/css/bootstrap.min.css" />
<script src="//code.jquery.com/jquery.min.js" type="text/javascript"></script>
<script type="text/javascript">
$(function () {
if (document.cookie.indexOf("cookies") < 0) {
$('[id*=dvCookieMessage]').slideDown('slow');
}
$('[id*=lnkOk]').on('click', function () {
document.cookie = "cookies=yes; max-age=" + (5 * 365 * 24 * 60 * 60);
$('[id*=dvCookieMessage]').slideUp('slow');
});
});
</script>
<div id="dvCookieMessage" style="display: none;">
<div>
<p>Your message <a href="#PolicyURL">Privacy Policy</a>.</p>
<a id="lnkOk" class="btn btn-xs btn-primary">Ok</a>
</div>
</div>