Topic: MDB5 Checkbox - check the value in javascript

smachesney free asked 3 years ago


I am using the MDB5 checkbox and want to use javascript to check if it's checked or not but the value turns up null. Looking at the window inspector when I check a checkbox, visually it changes but when clicked an "autocomplete" attribute appears but the value is still blank. I have tried setting the tag autocomplete=off but it doesn't work

Dawid Wajszczuk staff answered 3 years ago

I would suggest using document.querySelector('#idOfCheckbox').checked . It would return a boolean, true if it is checked and false if it is not checked.

Please insert min. 20 characters.


Hire our experts to build a dedicated project. We'll analyze your business requirements, for free.



Specification of the issue

  • ForumUser: Free
  • Premium support: No
  • Technology: MDB Standard
  • MDB Version: 3.2.0
  • Device: desktop
  • Browser: Chrome
  • OS: windows
  • Provided sample code: No
  • Provided link: No