You create a website.
It contains 2 text fields, with a single digit number each.
When the user changes the value of a text field, the client transmits the number to a server, asynchronously. No further interaction with the user is required.
As most visitors of the website are mobile users, the client must be able to deal with going offline. When the client comes back online, the values that have not been transmitted so far need to be transmitted.
Optional extra: showing a check mark next to the text field, for successful transmission to the server.
What would be the simplest solution, given you can use only HTML and JavaScript (and JavaScript libraries/frameworks)?