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 7958011
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 4, 20262026-06-04T04:21:15+00:00 2026-06-04T04:21:15+00:00

<label for=a1>First:</label> <input id=a1 class=first type=text name=a1 value=123> <label for=b1>Second:</label> <input id=b1 class=second type=text

  • 0
<label for="a1">First:</label>
<input id="a1" class="first" type="text" name="a1" value="123">
<label for="b1">Second:</label>
<input id="b1" class="second" type="text" name="b1"> <br />
<label for="a2">First:</label>
<input id="a2" class="first" type="text" name="a2"value="3424">
<label for="b2">Second:</label>
<input id="b2" class="second" type="text" name="b2"> <br />
<label for="a3">First:</label>
<input id="a3" class="first" type="text" name="a3"value="1235">
<label for="b3">Second:</label>
<input id="b3" class="second" type="text" name="b3"> <br />

$('.second').click(function(){
   var get_first = // ???
   $(this).val(get_first);
})

i would like for example – if i click on input b3 then in this value now is value from a3. how can i make it with next and prev in one class?

http://jsfiddle.net/Bgkrz/

  • 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-04T04:21:16+00:00Added an answer on June 4, 2026 at 4:21 am

    I’m not sure I can think of a reason for doing this, but assuming I understand your requirements correctly, then this should work (currently untested):

    $('input:text').focus(
        function(){
            var that = $(this);
            that.val(that.prevAll('input:text:first').val());
        });
    

    JS Fiddle demo.

    References:

    • :first selector.
    • prevAll().
    • :text selector.
    • val().
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

<div class=field50Pct> <div class=fieldItemLabel> <label for='First Name'>First Name:</label> </div> <div class=fieldItemValue> <input type=text id=firstname
This is my code so far: The HTML: <form> <label>First Name</label> <input type=text class=first
Suppose to have a code like this: <div class=notSelected> <label>Name <input type=text name=name id=name
I am trying to get a input and textarea label hide/show function to work,
I have a TextBox input element that has a RequiredFieldValidator as such: <div> <label>First
If I have 5 input boxes with the class .inputBox my jquery function adds
The error label displays till the width of the table. As this: alt text
I'm trying to pass a value from a select input control on an HTML
I have this classes who is mapped using Entity Framework Code First: public class
I am using the following code: $.each($('.friendName'), function(){ if($(this).val() != ''){ var idName =

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.