# typing/utils/inlinehighlight

module

<a id="functions">

## Functions

<a id="function-inlineHighlight">

### `inlineHighlight( editor, attributeName, tagName, className ) → void`

Adds a visual highlight style to an attribute element in which the selection is anchored. Together with two-step caret movement, they indicate that the user is typing inside the element.

Highlight is turned on by adding the given class to the attribute element in the view:

* The class is removed before the conversion has started, as callbacks added with the `'highest'` priority to [`DowncastDispatcher`](module_engine_conversion_downcastdispatcher-DowncastDispatcher.md) events.
* The class is added in the view post fixer, after other changes in the model tree were converted to the view.

This way, adding and removing the highlight does not interfere with conversion.

Usage:

```typescript
import { inlineHighlight } from '@ckeditor/ckeditor5-typing/src/utils/inlinehighlight';

// Make `ck-link_selected` class be applied on an `a` element
// whenever the corresponding `linkHref` attribute element is selected.
inlineHighlight( editor, 'linkHref', 'a', 'ck-link_selected' );
```

[See source](https://github.com/ckeditor/ckeditor5/blob/master/packages/ckeditor5-typing/src/utils/inlinehighlight.ts#L41)

#### Parameters

* `editor: Editor`

  The editor instance.

* `attributeName: string`

  The attribute name to check.

* `tagName: string`

  The tagName of a view item.

* `className: string`

  The class name to apply in the view.

#### Returns

* `void`

---

Full index of the CKEditor 5 API reference: [llms.txt](llms.txt)
