--- title: Bluetooth.onavailabilitychanged slug: Web/API/Bluetooth/onavailabilitychanged translation_of: Web/API/Bluetooth/onavailabilitychanged ---

{{APIRef("Bluetooth API")}}{{securecontext_header}}{{SeeCompatTable}}

The onavailabilitychanged property of the {{DOMxRef("Bluetooth")}} interface is an {{DOMxRef("EventHandler")}} that processes availabilitychanged events that fire when the Bluetooth system as a whole becomes available or unavailable to the {{Glossary("User Agent")}}.

Syntax

Bluetooth.onavailabilitychanged = functionRef;

Value

functionRef is the handler function to be called when the Bluetooth availabilitychanged event fires.

Specifications

Specification Status Comment
{{SpecName("Web Bluetooth", "#bluetooth", "Bluetooth")}} {{Spec2("Web Bluetooth")}} Initial definition.

Browser compatibility

{{compat ( "api.Bluetooth.onavailabilitychanged")}}

ดูสิ่งนี้ด้วย