---
title: onSuggestionSelected
framework: tvmljs
role: symbol
role_heading: Instance Property
path: tvmljs/keyboard/3678707-onsuggestionselected
---

# onSuggestionSelected

A function the system calls when the user selects a suggestion on a search field.

## Declaration

```data
attribute function onSuggestionSelected;
```

## Discussion

Discussion Provide a callback function for the onSuggestionSelected attribute to respond to the user selecting one of a searchField’s suggestions. This value of this attribute must be a function; for example, keyboard.onSuggestionSelected = function (searchTerm) {}.

## See Also

### Providing and Handling Search Suggestions

- [suggestions](tvmljs/keyboard/3589336-suggestions.md)
