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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 20, 20262026-05-20T16:50:49+00:00 2026-05-20T16:50:49+00:00

I have an array: wireholder.wires[] This array holds HTML tr elements with td children

  • 0

I have an array:

wireholder.wires[]

This array holds HTML tr elements with td children in each iteration:

wireholder.wires[1] = 
<tr class="trClass" id="blah">
    <td class="tdClass0">
         <select class="selectClass">
             <option value="1">Option1</option>
             <option value="2">Option2</option>
             <option value="3">Option3</option>
         </select>
    </td>
    <td class="tdClass1">
         <input class="inputClass1" type="text" />
    </td>
    <td class="tdClass2">
         <input class="inputClass2" type="text" />
    </td>
</tr>

I want to be able to target the class names in this arrays iteration.

Something like $(wireholder.wires[i].classNameHere) would be exactly what i’m after.

Has anyone heard of any ways to do something like this?


Solution

for(i=0;i<oldElement.length;i++){
    if($(node).find('.wire_selector_' + row).length){
        var oldWire = $(node).find('.wire_selector_' + row).val();
    }
    if($(node).find('.wire_length_' + row).length){
        var oldLength = $(node).find('.wire_length_' + row).val();
    }
    if($(node).find('.wire_retail_' + row).length){
        var oldPrice = $(node).find('.wire_retail_' + row).val()*100;
    }
}

For vol7ron

function DomFactory() 
{
    this.buildElement = function(elementType, props) {
        var el = document.createElement(elementType);
        for (var prop in props) {
            el.setAttribute(prop,  props[prop]);
        }
        return el;
    };

    this.buildTextNode = function(nodeData) {
        var node = document.createTextNode(nodeData);
        return node;
    };
}

Then using DomFactory:

var dom_builder = new DomFactory();
        var part_stub = dom_builder.buildElement("tr", {'class': "wiring_details_" + Wireholder.wires.length + "-" + part_id + "-" + zone_id, 'id': "wiring_rows_" + Wireholder.wires.length});
        var part_td = dom_builder.buildElement("td", {'colspan': '2'});
        var wire_type = dom_builder.buildTextNode("Wire Type: ");
        var select_wire = dom_builder.buildElement("select", {'class': 'wire_selector_' + Wireholder.wires.length, 'name': 'select_wire_' + Wireholder.wires.length});
        var wireValues = ["Select wire..", "14/2", "14/4", "16/4", "16/2", "RG6", "CAT5", "RG59", "LVT", "CAT6", "HDMI", "Shielded CAT6"];
        var length_stub = dom_builder.buildElement("td", {'colspan': '2'});
        var wire_length = dom_builder.buildTextNode("Length: ");
        var wire_length_input = dom_builder.buildElement("input", {'type': "text", 'class': 'wire_length_' + Wireholder.wires.length, 'name': 'wire_length_' + Wireholder.wires.length, 'value': '1'});
        var retail_stub = dom_builder.buildElement("td", {'colspan': '2'});
        var wire_retail_price = dom_builder.buildTextNode("Retail Price: ");
        var wire_retail_input = dom_builder.buildElement("input", {'type': "text", 'class': 'wire_retail_' + Wireholder.wires.length, 'name': 'wire_retail_' + Wireholder.wires.length, 'value': '0'});
        var total_stub = dom_builder.buildElement("td", {'colspan': '2', 'class': "wire_total"});
        var add_button = dom_builder.buildElement("a", {'href': "#", 'class': "add-button", 'id': "wiring_button_" + Wireholder.wires.length});
        var add_wire = dom_builder.buildTextNode("Add Wire");
        var wire_id = dom_builder.buildElement("input", {'type': "hidden", 'id': 'wire_id_<?php echo $part->id; ?>', 'name': 'wire_id_<?php echo $part->id; ?>', 'value': '<?php echo $part->wire_id; ?>'});
        that.appendChild(part_stub);
        Wireholder.wires.push(part_stub);

There is more but you get the idea…

  • 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-20T16:50:50+00:00Added an answer on May 20, 2026 at 4:50 pm

    Try this:

    $(wireholder.wires[1]).find(".tdClass1")
    

    By wrapping it with $() you make it into jQuery “collection” that can be searched for specific class etc..

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

Sidebar

Related Questions

Why, if I have array of objects like this: class testClass { private $_x
I have array like this: array('1224*', '543*', '321*' ...) which contains about 17,00 "masks"
I have array like this: array( array( 'id' => 1, 'children' => array( array(
I have array like this: $path = array ( [0] => site\projects\terrace_and_balcony\mexico.jpg [1] =>
I have array result like this: Array ( [0] => stdClass Object ( [id_global_info]
I have array of strings, String[] data and it's 10 elements has value P
An array is defined of assumed elements like I have array like String[] strArray
i have array in php, and i need work with this array in jQuery.
I have: $overr=array(); $overr[]=array(selector=>array('vi'=>mysql_num_rows($myquery),'pes'=> $pess,'prp'=>mysql_num_rows($my_3_query),'em_t'=>$u_h));//this is in a loop As you can see, I'm
I have array object in jquery. array=[]; array{Id:user.Id,Date:user.Date}; Now am going to pass this

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.