R
R
rsoinvi2018-07-02 15:26:56
React
rsoinvi, 2018-07-02 15:26:56

How to get input value on button click?

there is a code:

<input type="text" />
<input type="submit" value="click" />

How to get input value on click without query selector?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
A
Anton Spirin, 2018-07-02
@rsoinvi

There are two ways:
1. Use controlled input
2. Use ref

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question