How can I get a checkbox's value in jQuery?
Html – Get checkbox value in jQuery
checkboxformshtmljquery
Related Topic
- Javascript – Setting “checked” for a checkbox with jQuery
- Javascript – How to redirect to another webpage
- Javascript – How to know which radio button is selected via jQuery
- Javascript – How to check whether a checkbox is checked in jQuery
- Javascript – Get selected text from a drop-down list (select box) using jQuery
- Javascript – How to refresh a page with jQuery
- Javascript – How to return the response from an asynchronous call
Best Answer
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: