JSFiddle - React, Tailwind, and code Playground
HTML
<input type="text" class="input" />
<input type="text" class="input" />
<input type="checkbox" class="input">
<button>Get values<button>
JavaScript
$('button').click(function() {
inputs = $('.input');
inputs.each(function() {
var value;
if( $( this ).attr( 'type' ) === 'checkbox' ) {
value = $(this).is( ':checked' ) ? 1: 0;
}else
{
value = $(this).val();
}
alert(value);
});
});