Device & Sensors
Battery Status API
Monitor battery charge percentage, charging state, and discharge timer.
Checking support...
Feature Not SupportedThis browser does not support the Battery Status API Web API feature. Try testing in a modern browser (such as Chrome, Edge, Safari, or Firefox).
Advertisement
Interactive Input Workspace
Ready for input
Web API Execution Output
Result output will be displayed here after processing...
Native JavaScript Code Example (Zero Libraries)
const battery = await navigator.getBattery(); console.log(battery.level * 100 + '%', battery.charging);
About the Battery Status API Web API
Battery Status API provides information about the system's battery charge level.
Specification:W3C & WHATWG Web API Standard
Sponsored Content