Topic: Checkbox
KES
free
asked 3 years ago
Expected behavior Hi. How can I programmatically determine checkbox is pressed (active).
Actual behavior
Resources (screenshots, code snippets etc.)
Dawid Wajszczuk
staff
answered 3 years ago
Hi,
I'm not sure if by "active" you meant checked. If so, you need to simply add this JS code
document.querySelector('#checkbox').checked = true
Here is the snippet: https://mdbootstrap.com/snippets/standard/d-wajszczuk/3321576.
Keep coding,
Dawid
FREE CONSULTATION
Hire our experts to build a dedicated project. We'll analyze your business requirements, for free.
Answered
- ForumUser: Free
- Premium support: No
- Technology: MDB Standard
- MDB Version: MDB5 3.9.0
- Device: computer
- Browser: firefox
- OS: linux
- Provided sample code: No
- Provided link: No