0
By clicking the send button I want to take the input value and log console the value entered by the user! I think it’s simple but what I’m trying to do is more complex but will serve to implement what I need!
Made with React
- Input
- Send button
0
By clicking the send button I want to take the input value and log console the value entered by the user! I think it’s simple but what I’m trying to do is more complex but will serve to implement what I need!
Made with React
2
Tag <input />
must have the refs attribute and also create a button to trigger a function. Example
<input type='text' ref='nome' />
<button onClick={() => this.handleClick }>Enviar</button>
Create the function handleClick()
handleClick(){
const value = this.refs.nome.value;
console.log(value);
}
Browser other questions tagged html react
You are not signed in. Login or sign up in order to post.