KnowledgeHub
Questions
Tags
Users
Search
Alex Rivera
|
Logout
Edit Question
Title
Body
I'm trying to return the value of a checkbox to enable and disable a button. Making the checkbox is not a problem, the problem is the check box value always returns on. How should I get a value indicating if the checkbox is checked? HTML: <form> <input type="checkbox" id="checkbox" /> <label>Do you agree </label><br /> <input type="button" value="Continue" id="button" disabled="disabled" /> </form> Javascript: $('#checkbox').change(function(){ var checkboxValue = $(this).val(); alert(checkboxValue); });
Tags (comma-separated)
Save Edits
Cancel