Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8716689
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 13, 20262026-06-13T06:08:45+00:00 2026-06-13T06:08:45+00:00

I have a set of text inputs with a link to the right of

  • 0

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.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-13T06:08:46+00:00Added an answer on June 13, 2026 at 6:08 am

    You can use prev() method of jquery to find the previous element on click of anchor,

    Live Demo

    $('.show-color').click(function(){
        alert($(this).prev().val());
    });
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have this set (JsFiddle link) of labels and text inputs. How do I
I have set the styling for my text inputs as follows: /** INPUTS **/
Sample HTML/CSS: <div class=container> <input type=text /> <div class=filler></div> </div> div.container { padding: 5px;
I have set the value of a hidden input element dynamically on clicking a
I have a set of input fields that are stacked on top of each
I have set up an update query which will update values entered into text
I have a floated span with some text. I have set the overflow to
i have a problem, i want set text of a UILabel or UItextView or
I draw the text using CTFramesetter, I have set kCTParagraphStyleSpecifierParagraphSpacing , kCTParagraphStyleSpecifierLineSpacing , kCTParagraphStyleSpecifierParagraphSpacingBefore
I have a set of data that contains garbled text fields because of encoding

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.