JSFiddle - React, Tailwind, and code Playground

HTML

<form id="screen">
   
</form>
<input type="button" id="foo" value="test" />

JavaScript

var i= -1
while(++i<10){
    $('#screen').append( $('<input/>').attr({"type":"checkbox", "name":"selected_action"}).val(i) )
}

$('#foo').on('click', function(){

str=$('#screen').serialize()
alert(str)

})