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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 16, 20262026-05-16T12:40:45+00:00 2026-05-16T12:40:45+00:00

Yet another bit i’m stuck on $(div.evenprop .locname).each(function() { $(#ctl00_dd1 option).val(.locid).html($(this).clone()); });​ <select id=ctl00_dd1

  • 0

Yet another bit i’m stuck on

$("div.evenprop .locname").each(function() { $("#ctl00_dd1 option").val(".locid").html($(this).clone()); });​

<select id="ctl00_dd1" name="ctl00$dd1">
<option value="HANW"></option>
<option value="HEYD"></option></select>

<div style="displaY: none;">
<div class="evenprop"><h3 class="locname">Hanworth</h3><span class="locid" style="display:none">HANW</span></div>
<div class="evenprop"><h3 class="locname">Heydon</h3><span class="locid" style="display:none">HEYD</span></div>
</div>​​​​​​​​​​

I have a drop down list with two items in it and the values “HANW” and “HEYD” I’m trying to grab the locname that refers to that locid of the DDL and insert it into the DDL value if that makes any sense?

DDL should look like this with end result

<select id="ctl00_dd1" name="ctl00$dd1"><option value="Hanworth"></option><option value="Heydon"></option></select>

Thanks

Jamie

  • 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-16T12:40:45+00:00Added an answer on May 16, 2026 at 12:40 pm

    Why are you doing this? Can it not be rendered on the server the way it needs to be? The whole process seems very round-about here, I suggest you re-architect the overall approach. That being said, if there is a valid reason for doing it, this will do the job:

    $("div.evenprop .locid").each(function() { 
      $("#ctl00_dd1 option[value='" + $(this).text() + "']").text($(this).prev().text()); 
    });​
    

    You can give it a try here, here’s a more efficient version that’s a bit less terse:

    var opts = $("#ctl00_dd1 option");
    $("div.evenprop .locid").each(function() { 
      var locid = $(this).text();
      opts.filter(function() { return this.value == locid; }).text($(this).prev().text()); 
    });​
    

    You can give it a try here

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

Sidebar

Related Questions

I'm stuck at yet another C problem. How can I concatenate two strings with
Yet another simple question about unit testing model objects that uses data access layer.
Yet another list-comparing question. List<MyType> list1; List<MyType> list2; I need to check that they
I'm working on a little html/css framework that I can use for most of
I want to insert in sql query something like that: Select * from Users
I fear this has been beaten to death, but I'm still struggling with the
I'm trying to get the value of a number to 2 dec places from
So here's my project: I am building a central interface/dashboard to present the test
This may seem weird but I have a problem in one of my programs

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.