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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T21:09:21+00:00 2026-05-27T21:09:21+00:00

<p class=current style=display: block; >MD</p> <input type=text class=hidden value=MD style=display: none; > <p class=small

  • 0
<p class="current" style="display: block; ">MD</p>
<input type="text" class="hidden" value="MD" style="display: none; ">
<p class="small hidden" style="display: none; ">MD, MBBS etc.</p>
<a class="save-field-data btn hidden" data-id="medical_degree" href="#" style="display: none; ">Save</a>

The above explains my Html dom elements.
Say i am in a handler attached to the class "save-field-data"
How can i set the text of class current?

  • 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-05-27T21:09:22+00:00Added an answer on May 27, 2026 at 9:09 pm

    .prevAll() should help in this situation:

    $('.save-field-data').bind('click', function () {
        $(this).prevAll('.current').eq(0)...
    });
    

    I added the .eq(0) to select the first match in-case there are several .current elements that are siblings of the clicked .save-field-data element.

    Docs for .prevAll(): http://api.jquery.com/prevall

    Note: the difference between .prevAll() and .siblings() is that .prevAll() only searches the sibling elements that precede the current selection and .siblings() will select all siblings no matter if they come before or after the current selection.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

My current html looks like this: <div class=wrapper style=display:block; id=item0><!--- Stuff --></div> <div class=wrapper
<style> *{ margin:0; padding:0; border:0; } #navlist{ display:block; width: 100%; float: left; list-style: none;
I have the following JQuery statement and it is adding the class 'current' but
The current class library I am working on will have a base class (Field)
My current class is planning on creating a basic networked game, but we have
Is there a statement in AS3 that will return current class and/or scope? I'd
I know you can do this.GetType().FullName To get My.Current.Class But what can I call
In my current logging class I log the browser, browser version and javascript version.
My current solution consists of several Class Libraries and a Website. I'm in the
In my current project I noticed that all class fields and variable inside methods

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.