<input type="text" name="fruits[]" value="Apple">
<input type="text" name="fruits[]" value="Banana">
<input type="text" name="fruits[]" value="Orange">
My question is how to change the value of "Orange" to "Grapes" using jquery? The below code is not working.
<script>
$("input[name='fruits[2]']").val("Grapes");
</script>
Thanks in advance.