$ ./guess_the_languageProblem Solving — fix the bug
Problem Solving — fix the bug · medium · #182

Which fix removes the bug?

const btn = document.querySelector('#go');
btn.disabled = 'false';
  1. Assign the boolean false
  2. Remove the attribute
  3. Compare with === false
  4. Use setAttribute here
Any non-empty string is truthy, so the string 'false' leaves the button disabled.
Play Problem Solving ▸