I'm trying to call a bunch of cookies I have stored back onto a page. There are multiple ones with names like todo-0, todo-1 (you get the idea). So, I'm trying to figure out a way of calling all cookies that's name starts with 'todo-' and then print the value of that cookie to my page inside a table.
I was kinda hoping it would be as simple as:
if (document.cookie.name.match(/^todo-/)) {
todoTable.insertAdjacentHTML('beforeend', document.cooke.value);
}
But I get an error saying no method 'match'.
Any ideas about the best way to root through multiple cookies and fetch ones the start with todo- ?
document.cookie.name,document.cookiecontains string with all cookies assigned to document.