---
title: "search"
---
# search

Defined in: [src/plugins/search/search.ts:57](https://github.com/xdan/jodit/blob/main/src/plugins/search/search.ts#L57)

Search plugin. it is used for custom search in text
![search](https://user-images.githubusercontent.com/794318/34545433-cd0a9220-f10e-11e7-8d26-7e22f66e266d.gif)

## Example

```typescript
const jodit = Jodit.make('#editor', {
 useSearch: false
});
// or
const jodit = Jodit.make('#editor', {
 disablePlugins: 'search'
});
```

## Extends

- [`Plugin`](./plugin.Plugin.html)

### Constructor

**new search**(`jodit`): `search`

Defined in: [src/core/plugin/plugin.ts:52](https://github.com/xdan/jodit/blob/main/src/core/plugin/plugin.ts#L52)

#### Parameters

| Parameter | Type |
| ------ | ------ |
| `jodit` | [`IJodit`](../interfaces/types.IJodit.html) |

#### Returns

`search`

#### Inherited from

[`Plugin`](./plugin.Plugin.html).[`constructor`](./plugin.Plugin.html#constructor)

### STATUSES

`static` **STATUSES**: `object`

Defined in: [src/core/component/component.ts:40](https://github.com/xdan/jodit/blob/main/src/core/component/component.ts#L40)

#### beforeInit

`readonly` **beforeInit**: `"beforeInit"` = `'beforeInit'`

#### ready

`readonly` **ready**: `"ready"` = `'ready'`

#### beforeDestruct

`readonly` **beforeDestruct**: `"beforeDestruct"` = `'beforeDestruct'`

#### destructed

`readonly` **destructed**: `"destructed"` = `'destructed'`

#### Inherited from

[`Plugin`](./plugin.Plugin.html).[`STATUSES`](./plugin.Plugin.html#statuses)

***

### async

**async**: [`IAsync`](../interfaces/types.IAsync.html)

Defined in: [src/core/component/component.ts:44](https://github.com/xdan/jodit/blob/main/src/core/component/component.ts#L44)

#### Inherited from

[`Plugin`](./plugin.Plugin.html).[`async`](./plugin.Plugin.html#async)

***

### uid

`readonly` **uid**: `string`

Defined in: [src/core/component/component.ts:59](https://github.com/xdan/jodit/blob/main/src/core/component/component.ts#L59)

#### Inherited from

[`Plugin`](./plugin.Plugin.html).[`uid`](./plugin.Plugin.html#uid)

***

### ownerWindow

**ownerWindow**: [`Window`](https://developer.mozilla.org/docs/Web/API/Window) = `window`

Defined in: [src/core/component/component.ts:109](https://github.com/xdan/jodit/blob/main/src/core/component/component.ts#L109)

The window in which jodit was created

#### Inherited from

[`Plugin`](./plugin.Plugin.html).[`ownerWindow`](./plugin.Plugin.html#ownerwindow)

***

### jodit

**jodit**: [`IJodit`](../interfaces/types.IJodit.html)

Defined in: [src/core/component/view-component.ts:22](https://github.com/xdan/jodit/blob/main/src/core/component/view-component.ts#L22)

Parent View element

#### Inherited from

[`Plugin`](./plugin.Plugin.html).[`jodit`](./plugin.Plugin.html#jodit)

***

### requires

`static` **requires**: `string`[] = `[]`

Defined in: [src/core/plugin/plugin.ts:22](https://github.com/xdan/jodit/blob/main/src/core/plugin/plugin.ts#L22)

#### Inherited from

[`Plugin`](./plugin.Plugin.html).[`requires`](./plugin.Plugin.html#requires)

***

### hasStyle

**hasStyle**: `boolean` = `false`

Defined in: [src/core/plugin/plugin.ts:30](https://github.com/xdan/jodit/blob/main/src/core/plugin/plugin.ts#L30)

Plugin have CSS style and it should be loaded

#### Inherited from

[`Plugin`](./plugin.Plugin.html).[`hasStyle`](./plugin.Plugin.html#hasstyle)

***

### styles

**styles**: [`CanUndef`](../modules/types.html#canundef)\<`string`\>

Defined in: [src/core/plugin/plugin.ts:41](https://github.com/xdan/jodit/blob/main/src/core/plugin/plugin.ts#L41)

Additional plugin styles can be written simply as inline styles
```js
class A extends Jodit.modules.Plugin {
  styles = 'h1{color: red}';
}
```
Will only be applied if the plugin is activated

#### Inherited from

[`Plugin`](./plugin.Plugin.html).[`styles`](./plugin.Plugin.html#styles)

***

### buttons

**buttons**: [`IPluginButton`](../interfaces/types.IPluginButton.html)[] \| `undefined`

Defined in: [src/plugins/search/search.ts:58](https://github.com/xdan/jodit/blob/main/src/plugins/search/search.ts#L58)

#### Overrides

[`Plugin`](./plugin.Plugin.html).[`buttons`](./plugin.Plugin.html#buttons)

***

### walker

**walker**: [`Nullable`](../modules/types.html#nullable)\<[`LazyWalker`](./dom.LazyWalker.html)\> = `null`

Defined in: [src/plugins/search/search.ts:259](https://github.com/xdan/jodit/blob/main/src/plugins/search/search.ts#L259)

***

### walkerCount

**walkerCount**: [`Nullable`](../modules/types.html#nullable)\<[`LazyWalker`](./dom.LazyWalker.html)\> = `null`

Defined in: [src/plugins/search/search.ts:260](https://github.com/xdan/jodit/blob/main/src/plugins/search/search.ts#L260)

#### Get Signature

**get** **componentName**(): `string`

Defined in: [src/core/component/component.ts:46](https://github.com/xdan/jodit/blob/main/src/core/component/component.ts#L46)

##### Returns

`string`

#### Inherited from

[`Plugin`](./plugin.Plugin.html).[`componentName`](./plugin.Plugin.html#componentname)

***

#### Get Signature

**get** **ownerDocument**(): [`Document`](https://developer.mozilla.org/docs/Web/API/Document)

Defined in: [src/core/component/component.ts:95](https://github.com/xdan/jodit/blob/main/src/core/component/component.ts#L95)

The document in which jodit was created

##### Returns

[`Document`](https://developer.mozilla.org/docs/Web/API/Document)

#### Inherited from

[`Plugin`](./plugin.Plugin.html).[`ownerDocument`](./plugin.Plugin.html#ownerdocument)

***

#### Get Signature

**get** **od**(): [`Document`](https://developer.mozilla.org/docs/Web/API/Document)

Defined in: [src/core/component/component.ts:102](https://github.com/xdan/jodit/blob/main/src/core/component/component.ts#L102)

Shortcut for `this.ownerDocument`

##### Returns

[`Document`](https://developer.mozilla.org/docs/Web/API/Document)

#### Inherited from

[`Plugin`](./plugin.Plugin.html).[`od`](./plugin.Plugin.html#od)

***

#### Get Signature

**get** **ow**(): [`Window`](https://developer.mozilla.org/docs/Web/API/Window)

Defined in: [src/core/component/component.ts:110](https://github.com/xdan/jodit/blob/main/src/core/component/component.ts#L110)

##### Returns

[`Window`](https://developer.mozilla.org/docs/Web/API/Window)

#### Inherited from

[`Plugin`](./plugin.Plugin.html).[`ow`](./plugin.Plugin.html#ow)

***

#### Get Signature

**get** **isReady**(): `boolean`

Defined in: [src/core/component/component.ts:145](https://github.com/xdan/jodit/blob/main/src/core/component/component.ts#L145)

Component is ready for work

##### Returns

`boolean`

#### Inherited from

[`Plugin`](./plugin.Plugin.html).[`isReady`](./plugin.Plugin.html#isready)

***

#### Get Signature

**get** **isDestructed**(): `boolean`

Defined in: [src/core/component/component.ts:152](https://github.com/xdan/jodit/blob/main/src/core/component/component.ts#L152)

Component was destructed

##### Returns

`boolean`

#### Inherited from

[`Plugin`](./plugin.Plugin.html).[`isDestructed`](./plugin.Plugin.html#isdestructed)

***

#### Get Signature

**get** **isInDestruct**(): `boolean`

Defined in: [src/core/component/component.ts:160](https://github.com/xdan/jodit/blob/main/src/core/component/component.ts#L160)

The component is currently undergoing destructuring or has already been destroyed.
Those. you should not the app froze new events on him now or do anything else with him.

##### Returns

`boolean`

#### Inherited from

[`Plugin`](./plugin.Plugin.html).[`isInDestruct`](./plugin.Plugin.html#isindestruct)

***

#### Get Signature

**get** **componentStatus**(): [`ComponentStatus`](../modules/types.html#componentstatus)

Defined in: [src/core/component/component.ts:210](https://github.com/xdan/jodit/blob/main/src/core/component/component.ts#L210)

Current component status

##### Returns

[`ComponentStatus`](../modules/types.html#componentstatus)

#### Set Signature

**set** **componentStatus**(`componentStatus`): `void`

Defined in: [src/core/component/component.ts:217](https://github.com/xdan/jodit/blob/main/src/core/component/component.ts#L217)

Setter for current component status

##### Parameters

| Parameter | Type |
| ------ | ------ |
| `componentStatus` | [`ComponentStatus`](../modules/types.html#componentstatus) |

##### Returns

`void`

#### Inherited from

[`Plugin`](./plugin.Plugin.html).[`componentStatus`](./plugin.Plugin.html#componentstatus)

***

#### Get Signature

**get** **j**(): `T`

Defined in: [src/core/component/view-component.ts:27](https://github.com/xdan/jodit/blob/main/src/core/component/view-component.ts#L27)

Shortcut for `this.jodit`

##### Returns

`T`

#### Inherited from

[`Plugin`](./plugin.Plugin.html).[`j`](./plugin.Plugin.html#j)

***

#### Get Signature

**get** **defaultTimeout**(): `number`

Defined in: [src/core/component/view-component.ts:31](https://github.com/xdan/jodit/blob/main/src/core/component/view-component.ts#L31)

##### Returns

`number`

#### Inherited from

[`Plugin`](./plugin.Plugin.html).[`defaultTimeout`](./plugin.Plugin.html#defaulttimeout)

#### Call Signature

**getFullElName**(`elementName`): `string`

Defined in: [src/core/component/component.ts:65](https://github.com/xdan/jodit/blob/main/src/core/component/component.ts#L65)

Calc BEM element class name

##### Parameters

| Parameter | Type | Description |
| ------ | ------ | ------ |
| `elementName` | `string` | element name in the bem classification |

##### Returns

`string`

##### Inherited from

[`Plugin`](./plugin.Plugin.html).[`getFullElName`](./plugin.Plugin.html#getfullelname)

#### Call Signature

**getFullElName**(`elementName`, `mod`): `string`

Defined in: [src/core/component/component.ts:66](https://github.com/xdan/jodit/blob/main/src/core/component/component.ts#L66)

Calc BEM element class name

##### Parameters

| Parameter | Type | Description |
| ------ | ------ | ------ |
| `elementName` | `string` | element name in the bem classification |
| `mod` | `string` | - |

##### Returns

`string`

##### Inherited from

[`Plugin`](./plugin.Plugin.html).[`getFullElName`](./plugin.Plugin.html#getfullelname)

#### Call Signature

**getFullElName**(`elementName`, `mod`, `modValue`): `string`

Defined in: [src/core/component/component.ts:67](https://github.com/xdan/jodit/blob/main/src/core/component/component.ts#L67)

Calc BEM element class name

##### Parameters

| Parameter | Type | Description |
| ------ | ------ | ------ |
| `elementName` | `string` | element name in the bem classification |
| `mod` | `string` | - |
| `modValue` | `string` \| `boolean` | - |

##### Returns

`string`

##### Inherited from

[`Plugin`](./plugin.Plugin.html).[`getFullElName`](./plugin.Plugin.html#getfullelname)

***

### get()

**get**\<`T`\>(`chain`, `obj?`): [`Nullable`](../modules/types.html#nullable)\<`T`\>

Defined in: [src/core/component/component.ts:138](https://github.com/xdan/jodit/blob/main/src/core/component/component.ts#L138)

Safe get any field

#### Type Parameters

| Type Parameter |
| ------ |
| `T` |

#### Parameters

| Parameter | Type | Description |
| ------ | ------ | ------ |
| `chain` | `string` | the path to be traversed in the obj object |
| `obj?` | [`IDictionary`](../modules/types.html#idictionary) | the object in which the value is searched |

#### Returns

[`Nullable`](../modules/types.html#nullable)\<`T`\>

#### Example

```js
private a = {
  b: {
    c: {
      e: {
        g: {
          color: 'red'
        }
      }
    }
  }
}

this.get('a.b.c.e.g.color'); // Safe access to color
// instead using optionsl chaining
this?.a?.b?.c?.e?.g?.color
```

#### Inherited from

[`Plugin`](./plugin.Plugin.html).[`get`](./plugin.Plugin.html#get)

***

### bindDestruct()

**bindDestruct**(`component`): `this`

Defined in: [src/core/component/component.ts:170](https://github.com/xdan/jodit/blob/main/src/core/component/component.ts#L170)

Bind destructor to some View

#### Parameters

| Parameter | Type |
| ------ | ------ |
| `component` | [`IComponent`](../interfaces/types.IComponent.html) |

#### Returns

`this`

#### Inherited from

[`Plugin`](./plugin.Plugin.html).[`bindDestruct`](./plugin.Plugin.html#binddestruct)

***

### setStatus()

**setStatus**(`componentStatus`): `void`

Defined in: [src/core/component/component.ts:226](https://github.com/xdan/jodit/blob/main/src/core/component/component.ts#L226)

Set component status

#### Parameters

| Parameter | Type | Description |
| ------ | ------ | ------ |
| `componentStatus` | [`ComponentStatus`](../modules/types.html#componentstatus) | component status |

#### Returns

`void`

#### See

ComponentStatus

#### Inherited from

[`Plugin`](./plugin.Plugin.html).[`setStatus`](./plugin.Plugin.html#setstatus)

***

### hookStatus()

**hookStatus**(`status`, `callback`): `void`

Defined in: [src/core/component/component.ts:265](https://github.com/xdan/jodit/blob/main/src/core/component/component.ts#L265)

Adds a handler for changing the component's status

#### Parameters

| Parameter | Type | Description |
| ------ | ------ | ------ |
| `status` | [`ComponentStatus`](../modules/types.html#componentstatus) | the status at which the callback is triggered |
| `callback` | (`component`) => `void` | a function that will be called when the status is `status` |

#### Returns

`void`

#### Inherited from

[`Plugin`](./plugin.Plugin.html).[`hookStatus`](./plugin.Plugin.html#hookstatus)

***

### isInstanceOf()

`static` **isInstanceOf**\<`T`\>(`c`, `constructorFunc`): `c is T`

Defined in: [src/core/component/component.ts:283](https://github.com/xdan/jodit/blob/main/src/core/component/component.ts#L283)

#### Type Parameters

| Type Parameter |
| ------ |
| `T` *extends* [`Component`](./component.Component.html) |

#### Parameters

| Parameter | Type |
| ------ | ------ |
| `c` | `unknown` |
| `constructorFunc` | [`Function`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Function) |

#### Returns

`c is T`

#### Inherited from

[`Plugin`](./plugin.Plugin.html).[`isInstanceOf`](./plugin.Plugin.html#isinstanceof)

***

### i18n()

**i18n**(`text`, ...`params`): `string`

Defined in: [src/core/component/view-component.ts:35](https://github.com/xdan/jodit/blob/main/src/core/component/view-component.ts#L35)

#### Parameters

| Parameter | Type |
| ------ | ------ |
| `text` | `string` |
| ...`params` | (`string` \| `number`)[] |

#### Returns

`string`

#### Inherited from

[`Plugin`](./plugin.Plugin.html).[`i18n`](./plugin.Plugin.html#i18n)

***

### setParentView()

**setParentView**(`jodit`): `this`

Defined in: [src/core/component/view-component.ts:42](https://github.com/xdan/jodit/blob/main/src/core/component/view-component.ts#L42)

Attach component to View

#### Parameters

| Parameter | Type |
| ------ | ------ |
| `jodit` | [`IJodit`](../interfaces/types.IJodit.html) |

#### Returns

`this`

#### Inherited from

[`Plugin`](./plugin.Plugin.html).[`setParentView`](./plugin.Plugin.html#setparentview)

***

### destruct()

**destruct**(): `any`

Defined in: [src/core/component/view-component.ts:65](https://github.com/xdan/jodit/blob/main/src/core/component/view-component.ts#L65)

#### Returns

`any`

#### Inherited from

[`Plugin`](./plugin.Plugin.html).[`destruct`](./plugin.Plugin.html#destruct)

***

### className()

**className**(): `string`

Defined in: [src/core/plugin/plugin.ts:44](https://github.com/xdan/jodit/blob/main/src/core/plugin/plugin.ts#L44)

#### Returns

`string`

#### Inherited from

[`Plugin`](./plugin.Plugin.html).[`className`](./plugin.Plugin.html#classname)

***

### init()

**init**(`jodit`): `void`

Defined in: [src/core/plugin/plugin.ts:79](https://github.com/xdan/jodit/blob/main/src/core/plugin/plugin.ts#L79)

#### Parameters

| Parameter | Type |
| ------ | ------ |
| `jodit` | [`IJodit`](../interfaces/types.IJodit.html) |

#### Returns

`void`

#### Inherited from

[`Plugin`](./plugin.Plugin.html).[`init`](./plugin.Plugin.html#init)

***

### findQueryBounds()

**findQueryBounds**(`query`, `walkerKey`): [`Promise`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Promise)\<[`ISelectionRange`](../interfaces/types.ISelectionRange.html)[]\>

Defined in: [src/plugins/search/search.ts:111](https://github.com/xdan/jodit/blob/main/src/plugins/search/search.ts#L111)

#### Parameters

| Parameter | Type |
| ------ | ------ |
| `query` | `string` |
| `walkerKey` | `"walker"` \| `"walkerCount"` |

#### Returns

[`Promise`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Promise)\<[`ISelectionRange`](../interfaces/types.ISelectionRange.html)[]\>

***

### findAndReplace()

**findAndReplace**(`query`): [`Promise`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Promise)\<`boolean`\>

Defined in: [src/plugins/search/search.ts:134](https://github.com/xdan/jodit/blob/main/src/plugins/search/search.ts#L134)

#### Parameters

| Parameter | Type |
| ------ | ------ |
| `query` | `string` |

#### Returns

[`Promise`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Promise)\<`boolean`\>

***

### findAndSelect()

**findAndSelect**(`query`, `next`): [`Promise`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Promise)\<`boolean`\>

Defined in: [src/plugins/search/search.ts:189](https://github.com/xdan/jodit/blob/main/src/plugins/search/search.ts#L189)

#### Parameters

| Parameter | Type |
| ------ | ------ |
| `query` | `string` |
| `next` | `boolean` |

#### Returns

[`Promise`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Promise)\<`boolean`\>

***

### afterInit()

**afterInit**(`editor`): `void`

Defined in: [src/plugins/search/search.ts:358](https://github.com/xdan/jodit/blob/main/src/plugins/search/search.ts#L358)

#### Parameters

| Parameter | Type |
| ------ | ------ |
| `editor` | [`IJodit`](../interfaces/types.IJodit.html) |

#### Returns

`void`

#### Overrides

`Plugin.afterInit`

***

### beforeDestruct()

**beforeDestruct**(`jodit`): `void`

Defined in: [src/plugins/search/search.ts:453](https://github.com/xdan/jodit/blob/main/src/plugins/search/search.ts#L453)

#### Parameters

| Parameter | Type |
| ------ | ------ |
| `jodit` | [`IJodit`](../interfaces/types.IJodit.html) |

#### Returns

`void`

#### Overrides

`Plugin.beforeDestruct`
