JSFiddle - React, Tailwind, and code Playground

HTML

<input type="text" name="code" value="kode" />
<input type="checkbox" name="check" value="kode1" />

JavaScript

var str ="";
console.log($("input[type='text'], input[type='checkbox']"))
$("input[type='text'], input[type='checkbox']").each(function(){
     str +=  $(this).val() + "|";
});
console.log(str);