> For the complete documentation index, see [llms.txt](https://asad-razvi.gitbook.io/jest-enzyme-recipes/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://asad-razvi.gitbook.io/jest-enzyme-recipes/enzyme/how-can-i-simulate-a-change-to-an-input-field.md).

# How can I simulate a change to an input field?

```javascript
import { shallow } from 'enzyme'
const props = { onClick: jest.fn() }
const wrapper = <App {...props} />
const domNode = document.querySelector('#root')
const component = shallow(wrapper, domNode)

const selector = '.fld-input'
const eventName = 'change'
const eventInfo = { target: { value: 'hello' }}
component.find(selector).simulate(eventName, eventInfo)
expect(component.value()).toBe('hello')
```
