I have a checkbox and want to change the class of the button:
let able = 'btn btn-secondary" disabled';
function handleChange(e) {
let isChecked = e.target.checked;
if (isChecked===true){
able = '"btn btn-primary"';
console.log(able);
}
console logs "btn btn-primary" which is correct , however the button is not changing at all and in the return:
<input class="form-check-input" type="checkbox" id="gridCheck" onChange={e => handleChange(e)} />
<button type='submit' class={able}>Register</button>
Can someone please let me know what I am doing wrong?
Thank you in advance