Detecting battery level in a device or computer can help you inform the user of the current status. Within Mozilla’s WebAPI, we have the Battery API to offer that possibility. Accessing the battery First, it’s a matter of accessing the battery object: var battery = navigator.mozBattery; Properties There are a few properties offered to detect the charging level of the battery in the device: Battery
