NavigatorBattery
Summary
The NavigatorBattery interface is exposed on the Navigator object.
Properties
- battery
- The object that exposes the battery status information.
Methods
No methods.
Events
No events.
Examples
navigator.battery.onlevelchange = function () {
console.log(navigator.battery.level);
};
/* or alternatively */
navigator.battery.addEventListener('levelchange', function () {
console.log(navigator.battery.level);
}, false);
Related specifications
- Battery Status API
- W3C Last Call Working Draft