The jQuery Battery API allows you to check battery level and if the battery is charging or not