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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 31, 20262026-05-31T23:45:43+00:00 2026-05-31T23:45:43+00:00

I have a following structered DOM result, getting after a POST event: <root> <config>

  • 0

I have a following structered DOM result, getting after a POST event:

<root>
  <config>
      // Some inner tree
  </config>
  <test>
    <test testValue="0">
      <id>90</id>
      <time>false</time>
      <config>
        <config1>1</config1>
      </config>
      <languages>
        <language id="en" isDefault="true" >
          <test22 text=""  />
          <test23 text=""  />
        </language>
      </languages>
      <answers>
        <answer>
          <id>201</id>
          <Texts>
            <Text localeId="en" Text="Yes" />
          </Texts>
        </answer>
        <answer>
          <id>202</id>
          <Texts>
            <Text localeId="en"Text="No" />
          </Texts>
        </answer>
      </answers>
    </test>
  </test>
</root>

The above DOM returns after calling $.get(url, function(XML)), and I am able to do these:

Getting the Text (Yes, No), and id (201, 202) with the following code.

    $(XML).find("answer").each(function(){
        var textValue = $(this).find("Text").attr("Text");
        var idValue = $(this).find("id").text();
    });

But I couldn’t find the correct combination to get id (90) e.g. following didn’t work:

$(XML).find("test").children().attr("id");

It’s quite frustrating to debug jquery. I installed Firefox addon, Firequery, and saved the DOM into a file with html extension, but Firequery didn’t allow me to chain the functions like $.find(“id”).text(); . What is the way to get the id value 90 from DOM with jquery? What are you using to debug the jquery while working with DOM and XML files like in the snippet?

  • 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-31T23:45:44+00:00Added an answer on May 31, 2026 at 11:45 pm

    id is not an attribute but an element, so you sould select it like you selected text. To get 90, ask for .text() on the id element.

    $(XML).find('test').children('id').text();
    

    See http://jsfiddle.net/Mikey/FjnTS/

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

Sidebar

Related Questions

I have the following DOM structure: <div id=module-main> <div id=module-crumbs> <h4>Hello</h4> </div> </div> When
I have the following DOM structure: /*:DOC += <div id='testDiv' class='testDivClass'><div id='innerTestDiv'></div></div><span id='testSpan' class='testSpanClass'><span
Possible Duplicate: Prevent click event from affecting parent jquery I have a DOM structure
I have the following DOM structure (unordered list), that I would like to sort
I have the following DOM structure: <div class=city> <div class=a>Delete</div> <div class=b>Selected</div> <div class=c>Delete</div>
I have the following dom structure: <div class=ui-tabs> <ul> <li class=ui-state-default ui-tabs-selected ui-state-active> <a
Been struggling with this one I have the following DOM Structure: <ol id=add_images> <li>
I have the following DOM structure / HTML, I want to get (just practicing...)
I have the the following DOM structure which I want to sort according to
I have the following DOM structure.. <input id=WorkAssignmentID_3462 type=hidden value=3462 name=WorkAssignmentID/> <input id=WorkItemID_3462 type=hidden

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.