Take the next page with two forms with different classes, but each form has an input with the same name.
<form class='first_form'>
<input name='test' value='1' />
</form>
<form class='second_form'>
<input name='test' value='3'/>
</form>
I can get the form index, and I know the input name, but I do not know the input index.
Is there a way to associate the selector with the form index and input name to get the value?
I tried chaining but nothing works
var inputName = 'test';
Var formIndex = 1;
$('*[name="' + inputName + '"]' +' ' + '$("form").eq(' + formIndex + ')').val();
source
share