---
title: viewer3d.select
slug: viewer-3d/events/select
docTags: 
createdAt: 2024-03-01T14:15:15.678Z
---

Invoked when the user changes the set of selected objects in the scene.

## Example

::codepen{url="https://codepen.io/Catenda/embed/xxoLMKR"}

## Usage

:::CodeblockTabs
```javascript
const onSelect = function (event) {
  const { selected } = event;
  console.log("viewer3d.select", "selected: ", selected);
};

viewer3d.addEventListener("viewer3d.select", onSelect);
```

jQuery

```javascript
const onSelect = function (event, objectIds) {
  console.log("viewer.select", "objectIds: ", objectIds);
};

$("#viewer-3d").on("viewer.select", onSelect);
```
:::

## Parameters

### onSelect

::::Tabs
:::Tab{title="JS"}
Function called when the user changes the set of selected objects in the scene.

| **Type**                  |
| ------------------------- |
| `(event: Object) => Void` |

**event**

| **Name**   | **Type**       | **Description**             |
| ---------- | -------------- | --------------------------- |
| `selected` | Array\[String] | List of selected object ids |
:::

:::Tab{title="jQuery"}
Function called when the user changes the set of selected objects in the viewer.

| **Type**                                            |
| --------------------------------------------------- |
| `(event: Object, objectIds: Array[String]) => Void` |

**event**

[jQuery.Event](https://api.jquery.com/category/events/event-object/)

**objectIds**

List of selected object ids.
:::
::::

