Sunny Dhiman

Sunny Dhiman

  • 2k
  • 81
  • 1.8k

How to set multiple value in cookies

May 12 2021 5:32 AM
How to set multiple value in cookies single li click
this is my code
@foreach (var category in Model)
{
<li id="@category.CategoryId"><a href="/blog/category/@category.UrlSlug">@category.Title</a></li>
<li title="@category.Title"><a href="/blog/category/@category.UrlSlug"></a></li>
}
</ul>
<script>
$(document).ready(function () {
$(".category-list li").on("click", function () {
debugger;
var CategoryId = this.id;
Cookies.set('CategoryId', CategoryId);
var Title = this.title;
Cookies.set('Titile', Title);
});
});

Answers (1)