How can I get a checkbox's value in jQuery?
相关问题
- Views base64 encoded blob in HTML with PHP
- Laravel Option Select - Default Issue
- How to fix IE ClearType + jQuery opacity problem i
- jQuery add and remove delay
- Is there a way to play audio on a mobile browser w
Just to clarify things:
Will return 'true' or 'false'
Try this small solution:
or
To get the value of the Value attribute you can do something like this:
Or if you have set a
class
orid
for it, you can:However this will return the same value whether it is checked or not, this can be confusing as it is different to the submitted form behaviour.
To check whether it is checked or not, do: