1

what is the logic behind a checkbox value?
It is allways on regardless checked or not
I'm expecting a boolean like on-off, 0-1, true-false...
How can I get this?

$('button').on('click', function(){ let x = $('#inptest').val(); console.log(x); });
<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.3.1/jquery.min.js"></script> <button>CLICK</button> <input type='checkbox' id='inptest'>

1

0

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.