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

  • Home
  • SEARCH
  • 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 7969317
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 4, 20262026-06-04T07:13:06+00:00 2026-06-04T07:13:06+00:00

I am having some html which looks like this I need the innerHTML contents

  • 0

I am having some html which looks like this
I need the innerHTML contents for address1 range, city range and state range classes respecively for different std-address classes.

<div id="result-list">
            <div class="data">
                    <p class="std-address">
                        <span class="address1 range">some html content</span>
                        <span class="city range">some html content</span>
                        <span class="state range">some html content</span>

                    </p>
                    <p class="std-address">
                        <span class="address1 range">some html content</span>
                        <span class="city range">some html content</span>
                        <span class="state range">some html content</span>

                    </p>
                    <p class="std-address">
                        <span class="address1 range">some html content</span>
                        <span class="city range">some html content</span>
                        <span class="state range">some html content</span>

                    </p>
            </div>
</div>

I wrote the below mentioned code which was working properly untill i tested that on IE 8 and below

var addArrayX = document.getElementById("result-list").getElementsByClassName("std-address");


            for (i=0;i<addArrayX.length;i++){
                var address = addArrayX[i];
                stLine1 = trim(((address.getElementsByClassName("address1 range"))[0]).innerHTML);
                city = trim(((address.getElementsByClassName("city range"))[0]).innerHTML);
                state =  trim(((address.getElementsByClassName("state range"))[0]).innerHTML);
            }

Kindly help me in making this code IE compatible(using js prefererably or by jQuery)

here is the link for html
http://jsfiddle.net/H3HRN/9/

  • 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-04T07:13:07+00:00Added an answer on June 4, 2026 at 7:13 am

    if you want to use jquery then try this:

         $("[id*='result-list']").find("p[class*='std-address']").each(function () {
            var address = $(this).children("span[class*=address1]").html();
            var city = $(this).children("span[class*=city]").html();
            var state = $(this).children("span[class*=state]").html();
    
        });
    

    see here : http://jsfiddle.net/H3HRN/20/

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

Sidebar

Related Questions

I have some HTML which looks like this: <body> <div id=panel1 class=panel> Panel 1
i have a html table which looks like this: <table> <thead> <tr> <th >title1</th>
I am having a php file which executes some code to generate a html
I'm having a problem whereby I am trying to load some html onto a
What is the benefit to using Html.BeginForm? We're having some issues related to html
I need to parse HTML fragments, by which I mean the files lack <html>,
I'm having what at first looks like a typical margin related jerking problem with
I'm having some trouble with an Ajax script which disables my jQuery click events.
I tried a few things but this week i feel like my brain's having
I'm having some trouble getting log4net to work from ASP.NET 3.5. This is the

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.