--- title: Window.ongamepaddisconnected slug: Web/API/Window/ongamepaddisconnected translation_of: Web/API/Window/ongamepaddisconnected ---
The ongamepaddisconnected
property of the {{domxref("Window")}} interface represents an event handler that will run when a gamepad is disconnected (when the {{event('gamepaddisconnected')}} event fires).
The event object is of type {{domxref("GamepadEvent")}}.
window.ongamepaddisconnected = function() { ... };
window.ongamepaddisconnected = function() {
// A gamepad has been disconnected
};
Specification | Status | Comment |
---|---|---|
{{SpecName('Gamepad ', '#event-gamepaddisconnected', 'gamepaddisconnected event')}} | {{Spec2('Gamepad')}} | Initial definition |
{{Compat("api.Window.ongamepaddisconnected")}}