{
  "id": 22240591,
  "title": "How to Build a Persistent 3-Step Checklist Widget in 12 Lines of Vanilla JS (No Frameworks)",
  "url": "https://urgent.news/2026/11/27/how-to-build-a-persistent-3-step-checklist-widget-in-12-lines-of",
  "topic": "tech",
  "section": "Tech",
  "published": "2026-11-27T21:45:46.000Z",
  "source": {
    "name": "Dev.to",
    "slug": "dev-to",
    "url": "https://dev.to/irck_ysia_d79705b3a189af9/how-to-build-a-persistent-3-step-checklist-widget-in-12-lines-of-vanilla-js-no-frameworks-1d2i"
  },
  "original_language": "en",
  "account": "Building a persistent three-step checklist widget in 12 lines of vanilla JavaScript is possible without using any frameworks. By leveraging local storage, the widget can retain user progress across multiple tabs and browser sessions.\n\nTo create this widget, first insert three checkboxes with a class of \"cm-chk\" and a data attribute containing a step number (e.g., \"s1\", \"s2\", \"s3\"). Add a div with an id of \"cm-prog\" to display the current progress.\n\nNext, initialize a JavaScript object called `st` by parsing the value of local storage with a key of \"cm90\" or defaulting to an empty object. Define a function called `upd` that retrieves all the checkboxes, filters them based on their checked state, and calculates the number of completed steps and the associated monetary value. The progress percentage and monetary value are then updated in the \"cm-prog\" div.\n\nAttach event listeners to each checkbox, checking the box if its corresponding step is present in the `st` object. When the checkbox's state changes, update the `st` object with the new checked status and store it back in local storage. Finally, call the `upd` function initially to display the initial state.\n\nWith this simple yet robust approach, users can seamlessly navigate between cashback portals, retailer checkouts, and even browser extension settings, all while preserving their progress without the need for cookies or additional login walls.",
  "summary": "Most interactive checklists on the web pull in 150 KB of React state libraries just to toggle three checkboxes. When I built a live countdown & 3-step Cyber Monday cashback tracker for shoppers trying to avoid browser-extension cookie hijacking before Monday, Nov 30 at 11:59 PM PT , I wanted it to persist state across mobile tab reloads in 12 lines of zero-dependency JavaScript . The 12-Line…",
  "summary_source": "publisher",
  "key_points": [
    "Insert three checkboxes with class \"cm-chk\" and data attributes for step numbers",
    "Initialize JavaScript object st from local storage or default to empty object",
    "Update progress and monetary value in \"cm-prog\" div on checkbox state changes"
  ],
  "editors_take": null,
  "opinion": false,
  "illustration": null,
  "coverage": {
    "outlets": 1,
    "also_reported_by": []
  },
  "machine_translated": false,
  "ai_generated": true,
  "disclaimer": "Accounts, briefs, key points, the editor’s take and translations are written by software from other outlets’ reporting and may contain errors. A summary whose summary_source is \"publisher\" is the outlet’s own feed text. Always check the linked original."
}