How browser sticky notes work
This sticky notes tool is a client-side web application that runs entirely in the browser. When you create a note, the tool generates a DOM element with a textarea, color controls, and resizable handles. The underlying technology stack includes jQuery for DOM manipulation, jQuery UI for drag and resize interactions, and the Web Storage API (localStorage) for persisting note data. Memo content is not sent to a Funifytools server, and the page URL does not include your notes. This architecture is commonly referred to as a client-only architecture, where the tool logic and note data live in the browser.
The Document Object Model (DOM) is the programming interface that allows JavaScript to dynamically create, modify, and remove HTML elements. Each sticky note you see is a DOM element with nested children that the script builds at runtime. When you type, resize, or change colors, the corresponding DOM events fire and trigger save routines. For further reading on the DOM specification, refer to the MDN DOM documentation on Google and the W3C DOM Living Standard via Google.
Technical architecture and API usage
The tool follows a model-view-controller (MVC)-like
pattern at a small scale. The model is the JSON array
stored in localStorage. The view is the memo box DOM elements rendered
inside #memo-container. The controller logic lives in the
JavaScript functions addMemo(), saveMemos(),
loadMemos(), and attachMemoBehavior(). Each
function has a single responsibility, which keeps the code maintainable
and testable.
Key browser APIs used in this tool include:
- Web Storage API (localStorage): Stores key-value pairs persistently in the browser. Data survives page refreshes and browser restarts. The storage limit is typically 5 MB per origin according to the HTML Living Standard storage quota on Google.
- Fullscreen API: Lets the application expand to
occupy the entire screen using
requestFullscreen()andexitFullscreen(). The Fullscreen API specification on Google provides the authoritative reference. - Clipboard API: Used by the copy summary feature to
write text to the system clipboard asynchronously via
navigator.clipboard.writeText(). - jQuery UI Resizable and Draggable: Two interaction plugins that provide the resize handles and drag behavior. The official jQuery UI resizable documentation on Google explains the full API.
| Storage type | Persistence | Capacity | Scope |
|---|---|---|---|
| localStorage | Persistent until cleared | ~5 MB per origin | Per origin, all tabs |
| sessionStorage | Session only (tab close) | ~5 MB per origin | Per tab |
| IndexedDB | Persistent until cleared | Large (hundreds of MB) | Per origin |
| Cookies | Set by Expires / Max-Age | 4 KB per cookie | Per origin, sent with requests |
Local storage persistence mechanism
When you type into a note, the input event fires on the
textarea element. The event handler calls
saveMemos('Edited'), which iterates over every memo box in
the DOM, extracts the text, background color, font color, width, and
height of each note, and serializes the data into a JSON array. This
array is then written to localStorage under the key "memos"
using localStorage.setItem(). On page load,
loadMemos() reads the JSON string with
localStorage.getItem('memos'), parses it back into an
array, and reconstructs each memo box element.
The serialization format for each note object is:
text- the memo content as a stringfontColor- the text color as a hex string (e.g."#1f2937")backgroundColor- the background color as a hex stringsize- an object withwidthandheightnumeric values in pixels
The save routine skips notes with empty text to avoid storing blank placeholder cards. This design decision keeps the stored data compact and relevant. According to the MDN localStorage guide on Google, the API is synchronous, which means the save operation blocks the main thread momentarily. For the small data sizes in this tool, the performance impact is negligible.
| User action | DOM event | Save function call | Data persisted |
|---|---|---|---|
| Typing in a note | input |
saveMemos('Edited') |
All note data |
| Resizing a note | resizestop (jQuery UI) |
saveMemos('Resized') |
All note data |
| Changing background color | change on color input |
saveMemos('Background color changed') |
All note data |
| Changing text color | change on color input |
saveMemos('Text color changed') |
All note data |
| Deleting a note | click on close button |
saveMemos('Deleted') |
All note data |
jQuery UI interaction model
Each memo box is initialized with two jQuery UI interaction plugins:
Resizable and Draggable. The resizable
plugin adds handles to all four edges and corners by setting
handles: 'all'. The minimum dimensions are constrained to
150 px wide and 100 px tall through the minWidth and
minHeight options. When the user finishes a resize
operation, the stop callback fires and triggers a save.
The draggable plugin is disabled by default (disabled: true)
to prevent accidental movement while typing. The wrench control toggles
the draggable state between enabled and disabled. When enabled, the note
can be freely repositioned within the workspace. The combination of
resizable and draggable on the same element is a well known pattern in
jQuery UI, and the official jQuery UI draggable and resizable
combination guide on Google covers best practices for this
setup.
| Plugin | Option | Value | Purpose |
|---|---|---|---|
| Resizable | handles |
'all' |
Enable resize from all edges and corners |
minWidth |
150 |
Prevent shrinking below usable size | |
minHeight |
100 |
Prevent shrinking below usable size | |
| Draggable | disabled |
true (initially) |
Prevent accidental drag while editing text |
Performance and security considerations
Because memo data stays in localStorage, this tool does not transmit note content to a Funifytools server. The page still loads external resources such as Google Analytics (for page-level traffic measurement), Google Fonts (for typography), and CDN-hosted libraries (jQuery and jQuery UI). For privacy, avoid storing highly confidential information in browser localStorage, especially on shared devices.
For users concerned about data privacy, the localStorage data can be
cleared at any time using the Reset button, which calls
localStorage.removeItem('memos'). Additionally, clearing
the browser site data or using a private browsing session will also
remove the stored notes. The same origin policy explained on MDN
via Google provides authoritative background on how browsers
isolate data between different origins.
From a performance standpoint, the tool uses
JSON.stringify() and JSON.parse() for
serialization. These operations are synchronous and run on the main
thread, but for the typical note count in this tool, the overhead is
usually small. Resize and drag responsiveness can still vary by device,
browser, and the number of rendered notes. If you need to store a very
large number of notes, consider switching to
IndexedDB, which is asynchronous and better suited for larger datasets
as shown in Table 1.