Hope you’re well! I’m still working on this to-do list site and I’m a little stuck for the best way to track if one of the items has been marked as done, and then how to update the cookie that stores the to-do to only load a checked checkbox.
I’ve seen things like unload and onbeforeunload which seem like a possible way to go, checking through each checkbox on a page unload then storing the status in the cookie for next time the user visits the page.
But I’m wondering if there are any other suggestions? W3schools thinks onunload doesn’t work in Opera or Chome (shockingly!) which would be a definite no-go if that is the case.
haha, I’m working on exactly that idea right now! Great minds!
In a bit of a pickle with it though! I’ve managed to get it so when a checkbox is checked, it pulls down the cookie for that particular item. But now I need to find just the `input` element inside that variable. Searching around there doesn’t seem to be a way to do this? Ideally I’d just type `variableName.getElementsByTagName(input)` but the `getElementByTagName` only works on `document.` humpf!
I was thinking that, instead of pulling the cookie down and trying to edit that, just get all the code from the row and save over the cookie that’s already there. Might be a better way to go with less code too maybe.
Hmm, I have the `tr` element after an `onClick` I put in the `tr`. But I can’t seem to get anything other than “[object HTMLTableRowElement]”, It wont give me the value or the code of the object itself, only seems to tell me what it is :/