The onactivate EventHandler is called when one of the Sensor interface's child interfaces becomes active.


sensorInstance.onactivate = function
sensorInstance.addEventListener('activate', function() { ... })

Because Sensor is a base class, onactivate may only be used on one of its derived classes.


Specification Status Comment
Generic Sensor API
The definition of 'onactivate' in that specification.
Candidate Recommendation Initial definition.

Browser compatibility

BCD tables only load in the browser