MENU
htmlFor
Similarly, because 'for' is a JavaScript keyword, we should use 'htmlFor' instead when trying to use the attribute 'for'.
Below, clicking the text checks or unchecks the checkbox.
RESETRUNFULL
RESETRUNFULL
function MyForm(props) {
return (<form>
<input id="agree_checkbox" type="checkbox"/>
<label htmlFor="agree_checkbox">Do you agree with the terms?</label>
</form>);}ReactDOM.render(<MyForm/>, document.querySelector('div'));