# getValue

Get the value of a `<textarea>`, `<select>` or text `<input>` found by given selector. If multiple elements are found via the given selector, an array of values is returned instead. For input with checkbox or radio type use isSelected.

## Usage[​](#usage "Direct link to Usage")

```
await $(selector).getValue()
```

## Examples[​](#examples "Direct link to Examples")

index.html

```
<input type="text" value="John Doe" id="username">
```

getValue.js

```
it('should demonstrate the getValue command', async () => {
    const inputUser = await $('#username');
    const value = await inputUser.getValue();
    console.log(value); // outputs: "John Doe"
});
```

## Returns[​](#returns "Direct link to Returns")

* **\<String>** **`return`:** requested element(s) value
