Answers for "react state of checkbox"

8

reactjs get checkbox value

handleChange(e) {
  let isChecked = e.target.checked;
  // do whatever you want with isChecked value
}

render() {
  // ... your code here
  return (
    {/* your other jsx here */}
    <Checkbox otherProps onChange={e => this.handleChange(e)} />
    {/* your other jsx here */}
  );
}
Posted by: Guest on July-14-2021
0

get the state of a checkbox

function checkAddress()
{
    var chkBox = document.getElementById('checkAddress');
    if (chkBox.checked)
    {
        // ..
    }
}
Posted by: Guest on June-07-2020

Code answers related to "Javascript"

Browse Popular Code Answers by Language