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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 3, 20262026-06-03T23:42:19+00:00 2026-06-03T23:42:19+00:00

As the title describes, here is my basic xhtml page: <!DOCTYPE html PUBLIC -//W3C//DTD

  • 0

As the title describes, here is my basic xhtml page:

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">

<head>
    <title>An XHTML 1.0 Strict standard template</title>
    <meta http-equiv="content-type" content="text/html;charset=utf-8" />

    <script type="text/javascript">
        var headings = document.evaluate('//h2', document, null, XPathResult.ANY_TYPE, null );
        var thisHeading = headings.iterateNext();  

        var alertText = 'Level 2 headings in this document are:\n'  

        while (thisHeading) {  
            alertText += thisHeading.textContent + '\n';  
            thisHeading = headings.iterateNext();  
        } 

        console.log(alertText);
    </script>

</head>

<body>

 <h2>… Your HTML content here …</h2>

</body>
</html>

Output is:

Level 2 headings in this document are:

  • 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-03T23:42:21+00:00Added an answer on June 3, 2026 at 11:42 pm

    web browsers process the html from top to bottom. Your script runs before the rest of the page exists. Move it down, or execute the code on the window onload event.

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

Sidebar

Related Questions

As the title describes. I need to see if the machine accessing my page
Well the title pretty well describes my problem. Here is a little bit more
For example, consider the following example <?xml version=1.0 ?> <rdf:RDF xmlns:rdf=http://www.w3.org/1999/02/22-rdf-syntax-ns# xmlns:dc=http://purl.org/dc/elements/1.1/> <rdf:Description rdf:about=http://en.wikipedia.org/wiki/Tony_Benn>
Google News has API, described here: http://code.google.com/apis/newssearch/v1/index.html But it is a JavaScript API (client
As the title describes, I'm trying to group up a grid of 3x3 radio
Not entirely sure my question title describes what I want to do, but couldn't
I have a UITableView that has five sections. Just as the title describes cellForRowAtIndexPath
Not sure the title fully describes the problem/question I'm trying to ask, sorry. One
Well, title self describes it.. I need to run a sql function to clean
First of all, I'm not sure if the title accurately describes what I'm referring

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.