MDN self-hosted library · e01.org

HIDDevice: productName property

WebHID APIwindowandworkerexceptshared

Open notebook · 1 cells web-api-instance-property upstream source

WebHID APIwindow_and_worker_except_shared

The productName read-only property of the HIDDevice interface returns the product name of the connected HID device.

Value

A string.

Examples

The following example retrieves devices with HID.getDevices() and logs the value of productName to the console.

let devices = await navigator.hid.getDevices();
devices.forEach((device) => {
  console.log(`HID: ${device.productName}`);
});

Specifications

Browser compatibility