I have a set of text inputs with a link to the right of each
<p><input type="text" name="color[]" value="orange" /> <a href="#" class="show-color">color</a><br />
<input type="text" name="color[]" value="purple" /> <a href="#" class="show-color">color</a><br />
<input type="text" name="color[]" value="blue" /> <a href="#" class="show-color">color</a></p>
I want to find out the value of the input field that is next to the link I clicked, using jQuery, any help is appreciated.
You can use prev() method of jquery to find the previous element on click of anchor,
Live Demo