JSFiddle - React, Tailwind, and code Playground
HTML
<input name="sel[]" value="1"/>
<input name="sel[]" value="2"/>
JavaScript
$(function(){
$('body').append('<br/><br/>'+$('input[name=sel[]]').length)
})
<input name="sel[]" value="1"/>
<input name="sel[]" value="2"/>
$(function(){
$('body').append('<br/><br/>'+$('input[name=sel[]]').length)
})