I have managed to created a small demo of login application which works in online and offline mode. In addition to this i have tried to use Web Storage and Session storage . Hope some one could better it anyway.
You could find the database feature in Chrome or Safari under Developer in section "Storage" and could run SQL queries. It seems Online detecting feature is not working in chrome and safari browser, but works in iphone and other device.