# Methods

The Bootstrap input component extends the [wire.ui.component](https://docs.wirebootstrap.com/wirebootstrap/reference/wire.ui/wire.ui.component) class.  As such, it inherits all its base methods.

The following methods are added to the Bootstrap input component.

| Name             | Description                                                                                                               |
| ---------------- | ------------------------------------------------------------------------------------------------------------------------- |
| clear            | Clears the current input value and restores it to its default state                                                       |
| dirty(val)       | Returns whether there has been a change to the default input value. Optionally sets the dirty value to `val` if supplied. |
| val              | Returns the current value set in the config's `datamap.value`. Optionally sets the current value to `val` if supplied.    |
| validate(config) | Validates the current value using the rules set up in the config                                                          |

```javascript
const users = [
    { value: "Jim Kennedy" }
]

const input = new wire.bsInput().render("#input", {
    data: users
});

// returns the current value in the input 
const value = input.val();
```
