# ScriptComponentElement

Class · extends [`ComponentElement`](https://api.playcanvas.com/web-components/classes/ComponentElement.md)`<ScriptComponent>` · category: Components

Source: https://github.com/playcanvas/web-components/blob/514c3dca7f4cd5725abca9e6b7641352587fe50c/src/components/script-component.ts#L277

The ScriptComponentElement interface provides properties and methods for manipulating
[`<pc-script>`](https://developer.playcanvas.com/user-manual/web-components/tags/pc-script/) elements.
The ScriptComponentElement interface also inherits the properties and methods of the
[HTMLElement](https://developer.mozilla.org/docs/Web/API/HTMLElement) interface.

Engine component: [ScriptComponent](https://api.playcanvas.com/engine/classes/ScriptComponent.html) (`script`).

**elementSummary** The `<pc-script>` element holds the `<pc-script-instance>` children that attach
scripts to its entity. Must be a child of a `<pc-entity>`, `<pc-model>` or `<pc-node>`.

## Accessors

### component

```ts
get component(): ScriptComponent | null
```

Gets the underlying PlayCanvas script component. `null` until the element is
ready — see [ComponentElement.component](https://api.playcanvas.com/web-components/classes/ComponentElement.md#component).

## Methods

### initComponent

```ts
protected initComponent(): void
```

Configures the newly added component. Overridden by subclasses whose setup goes beyond
the initial data — child-element handling, asset resolution and the like.

## Inherited from [ComponentElement](https://api.playcanvas.com/web-components/classes/ComponentElement.md)

- `get closestApp(): AppElement | null`
- `get closestEntity(): EntityBaseElement | null`
- `get enabled(): boolean` · `set enabled(value: boolean)`
- `protected _onReady(): void`
- `protected _resetReady(): void`
- `protected getInitialComponentData(): {}`
- `ready(): Promise<ScriptComponentElement>`
