JSFiddle - React, Tailwind, and code Playground
HTML
<input id="1" name="myText" type="text" value="20"/>
<input id="2" name="myText" type="text" value="30"/>
<input id="3" name="myText" type="text" value="40"/>
JavaScript
var id = $('[name="myText"]').get(1).id;
alert(id);
id = $('[name="myText"]:eq(1)').attr('id');
alert(id);