obter o valor id por índice usando o nome jquery
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"/>
Como posso obter o valor de id porindex
usando o nome?
O trecho de código a seguir não está funcionando
var getVal = $('[name="myText"]').index(1);