Hi guys i need some help with "Technical documantation page"

when i run the code it keeps saying
" Each .main-section should have an id that matches the text of its first child, having any spaces in the child’s text replaced with underscores (_ ) for the id’s. "

Hi @Nkulleko01

Please provide with a full code so that we know wehre you got it wrong :slight_smile:

 <main id="main-doc">
    <section class="main-section" id="introduction">
      <header>
        <h2>introduction</h2>
        </header>
        <p>JavaScript is a cross-platform, object-oriented scripting language. It is a small and lightweight language. Inside a host environment (for example, a web browser), JavaScript can be connected to the objects of its environment to provide programmatic control over them.</p>
        <p>JavaScript contains a standard library of objects, such as Array, Date, and Math, and a core set of language elements such as operators, control structures, and statements. Core JavaScript can be extended for a variety of purposes by supplementing it with additional objects; for example:
          <ul class="list">
            <li>Client-side JavaScript extends the core language by supplying objects to control a browser and its Document Object Model (DOM). For example, client-side extensions allow an application to place elements on an HTML form and respond to user events such as mouse clicks, form input, and page navigation.</li><br>
            <li>Server-side JavaScript extends the core language by supplying objects relevant to running JavaScript on a server. For example, server-side extensions allow an application to communicate with a database, provide continuity of information from one invocation to another of the application, or perform file manipulations on a server.</li>
          </ul>
        </p>
    </section>
    <section class="main-section" id="What you should already know">
      <header>
        <h2>What you should already know</h2></header>
      <p>This guide assumes you have the following basic background:</p>
      <ul>
        <li>A general understanding of the Internet and the World Wide Web (WWW).</li><br>
        <li>Good working knowledge of HyperText Markup Language (HTML).</li><br>
        <li>Some programming experience. If you are new to programming, try one of the tutorials linked on the main page about JavaScript.</li>
      </ul>
    </section>
     <section class="main-section" id="Hello world">
       <header>
         <h2>Hello world</h2>
         </header>
       <p>To get started with writing JavaScript, open the Scratchpad and write your first "Hello world" JavaScript code:</p>
       <code>function greetMe(yourName) { alert("Hello " + yourName); }
greetMe("World");</code>
        <p>Select the code in the pad and hit Ctrl+R to watch it unfold in your browser!</p>
     </section>
      <section class="main-section" id="Variable scope">
        <header>
          <h2>Variable scope</h2>
          </header>
        <p>When you declare a variable outside of any function, it is called a global variable, because it is available to any other code in the current document. When you declare a variable within a function, it is called a local variable, because it is available only within that function.</p>
        <p>JavaScript before ECMAScript 2015 does not have block statement scope; rather, a variable declared within a block is local to the function (or global scope) that the block resides within. For example the following code will log 5, because the scope of x is the function (or global context) within which x is declared, not the block, which in this case is an if statement.</p>
        <code>if (true) { var x = 5; } console.log(x); // 5</code>
        <p>This behavior changes, when using the let declaration introduced in ECMAScript 2015.</p>
        <code>if (true) { let y = 5; } console.log(y); // ReferenceError: y is
not defined</code></br>
      </section>
     <section class="main-section" id="Variables">
       <header>
         <<h2>Variables</h2>
         </header>
       <p>You use variables as symbolic names for values in your application. The names of variables, called identifiers, conform to certain rules.</p>
       <p>A JavaScript identifier must start with a letter, underscore (_), or dollar sign ($); subsequent characters can also be digits (0-9). Because JavaScript is case sensitive, letters include the characters "A" through "Z" (uppercase) and the characters "a" through "z" (lowercase).</p>
       <p>You can use ISO 8859-1 or Unicode letters such as å and ü in identifiers. You can also use the Unicode escape sequences as characters in identifiers. Some examples of legal names are Number_hits, temp99, and _name.</p>
     </section>
      <section class="main-section" id="Function declarations">
        <header>
          <h2>Function declarations</h2>
          </header>
        <p>A function definition (also called a function declaration, or function statement) consists of the function keyword, followed by:</p>
        <ul>
          <li>The name of the function.</li><br>
          <li>A list of arguments to the function, enclosed in parentheses and separated by commas.</li><br>
          <li>The JavaScript statements that define the function, enclosed in curly brackets, { }.</li>
        </ul>
        <p>For example, the following code defines a simple function named square:</p>
        <code>function square(number) { return number * number; }</code>
        <p>The function square takes one argument, called number. The function consists of one statement that says to return the argument of the function (that is, number) multiplied by itself. The return statement specifies the value returned by the function.</p>
        <code>return number * number;</code>
        <p>Primitive parameters (such as a number) are passed to functions by value; the value is passed to the function, but if the function changes the value of the parameter, this change is not reflected globally or in the calling function.</p>
      </section>
     <section class="main-section" id="Global variables">
       <header>
         <h2>Global variables</h2>
         </header>
       <p>Global variables are in fact properties of the global object. In web pages the global object is window, so you can set and access global variables using the window.variable syntax.</p>
       <p>Consequently, you can access global variables declared in one window or frame from another window or frame by specifying the window or frame name. For example, if a variable called phoneNumber is declared in a document, you can refer to this variable from an iframe as parent.phoneNumber.</p>
      </section>  
  </main>
</html>

Interesting read of JavaScript!

Can you enclose your code behind a triple backtick like this?

```html
<!-- paste html code here -->
```

also provide your css like this

```css
/* paste css here */
```

i will try to enclose my html

about css i hav’nt write yet

Ok that’s fine, let us see your html so we can help you out :+1:

t <main id="main-doc">
    <section class="main-section" id="introduction">
      <header>
        <h2>introduction</h2>
        </header>
        <p>JavaScript is a cross-platform, object-oriented scripting language. It is a small and lightweight language. Inside a host environment (for example, a web browser), JavaScript can be connected to the objects of its environment to provide programmatic control over them.</p>
        <p>JavaScript contains a standard library of objects, such as Array, Date, and Math, and a core set of language elements such as operators, control structures, and statements. Core JavaScript can be extended for a variety of purposes by supplementing it with additional objects; for example:
          <ul class="list">
            <li>Client-side JavaScript extends the core language by supplying objects to control a browser and its Document Object Model (DOM). For example, client-side extensions allow an application to place elements on an HTML form and respond to user events such as mouse clicks, form input, and page navigation.</li><br>
            <li>Server-side JavaScript extends the core language by supplying objects relevant to running JavaScript on a server. For example, server-side extensions allow an application to communicate with a database, provide continuity of information from one invocation to another of the application, or perform file manipulations on a server.</li>
          </ul>
        </p>
    </section>
    <section class="main-section" id="What you should already know">
      <header>
        <h2>What you should already know</h2></header>
      <p>This guide assumes you have the following basic background:</p>
      <ul>
        <li>A general understanding of the Internet and the World Wide Web (WWW).</li><br>
        <li>Good working knowledge of HyperText Markup Language (HTML).</li><br>
        <li>Some programming experience. If you are new to programming, try one of the tutorials linked on the main page about JavaScript.</li>
      </ul>
    </section>
     <section class="main-section" id="Hello world">
       <header>
         <h2>Hello world</h2>
         </header>
       <p>To get started with writing JavaScript, open the Scratchpad and write your first "Hello world" JavaScript code:</p>
       <code>function greetMe(yourName) { alert("Hello " + yourName); }
greetMe("World");</code>
        <p>Select the code in the pad and hit Ctrl+R to watch it unfold in your browser!</p>
     </section>
      <section class="main-section" id="Variable scope">
        <header>
          <h2>Variable scope</h2>
          </header>
        <p>When you declare a variable outside of any function, it is called a global variable, because it is available to any other code in the current document. When you declare a variable within a function, it is called a local variable, because it is available only within that function.</p>
        <p>JavaScript before ECMAScript 2015 does not have block statement scope; rather, a variable declared within a block is local to the function (or global scope) that the block resides within. For example the following code will log 5, because the scope of x is the function (or global context) within which x is declared, not the block, which in this case is an if statement.</p>
        <code>if (true) { var x = 5; } console.log(x); // 5</code>
        <p>This behavior changes, when using the let declaration introduced in ECMAScript 2015.</p>
        <code>if (true) { let y = 5; } console.log(y); // ReferenceError: y is
not defined</code></br>
      </section>
     <section class="main-section" id="Variables">
       <header>
         <<h2>Variables</h2>
         </header>
       <p>You use variables as symbolic names for values in your application. The names of variables, called identifiers, conform to certain rules.</p>
       <p>A JavaScript identifier must start with a letter, underscore (_), or dollar sign ($); subsequent characters can also be digits (0-9). Because JavaScript is case sensitive, letters include the characters "A" through "Z" (uppercase) and the characters "a" through "z" (lowercase).</p>
       <p>You can use ISO 8859-1 or Unicode letters such as å and ü in identifiers. You can also use the Unicode escape sequences as characters in identifiers. Some examples of legal names are Number_hits, temp99, and _name.</p>
     </section>
      <section class="main-section" id="Function declarations">
        <header>
          <h2>Function declarations</h2>
          </header>
        <p>A function definition (also called a function declaration, or function statement) consists of the function keyword, followed by:</p>
        <ul>
          <li>The name of the function.</li><br>
          <li>A list of arguments to the function, enclosed in parentheses and separated by commas.</li><br>
          <li>The JavaScript statements that define the function, enclosed in curly brackets, { }.</li>
        </ul>
        <p>For example, the following code defines a simple function named square:</p>
        <code>function square(number) { return number * number; }</code>
        <p>The function square takes one argument, called number. The function consists of one statement that says to return the argument of the function (that is, number) multiplied by itself. The return statement specifies the value returned by the function.</p>
        <code>return number * number;</code>
        <p>Primitive parameters (such as a number) are passed to functions by value; the value is passed to the function, but if the function changes the value of the parameter, this change is not reflected globally or in the calling function.</p>
      </section>
     <section class="main-section" id="Global variables">
       <header>
         <h2>Global variables</h2>
         </header>
       <p>Global variables are in fact properties of the global object. In web pages the global object is window, so you can set and access global variables using the window.variable syntax.</p>
       <p>Consequently, you can access global variables declared in one window or frame from another window or frame by specifying the window or frame name. For example, if a variable called phoneNumber is declared in a document, you can refer to this variable from an iframe as parent.phoneNumber.</p>
      </section>  
  </main>
</html>
ype or paste code here
1 Like

Each .main-section should have an id that matches the text of its first child, having any spaces in the child’s text replaced with underscores (_ ) for the id’s.

Such that if your <h2> is “What you should already know”

then the id of the parent section element would be

id="What_you_should_already_know"

Since you have to replace the whitespace with underscore.

Do you get what I mean?

yes i get it let me try it then i will get back to you

the code still doesn’t pass

Can you post your new code? and the problem you are having

<html>
  <main id="main-doc">
    <section class="main-section" id="introduction">
      <header>
        <h2>introduction</h2>
        </header>
        <p>JavaScript is a cross-platform, object-oriented scripting language. It is a small and lightweight language. Inside a host environment (for example, a web browser), JavaScript can be connected to the objects of its environment to provide programmatic control over them.</p>
        <p>JavaScript contains a standard library of objects, such as Array, Date, and Math, and a core set of language elements such as operators, control structures, and statements. Core JavaScript can be extended for a variety of purposes by supplementing it with additional objects; for example:
          <ul class="list">
            <li>Client-side JavaScript extends the core language by supplying objects to control a browser and its Document Object Model (DOM). For example, client-side extensions allow an application to place elements on an HTML form and respond to user events such as mouse clicks, form input, and page navigation.</li><br>
            <li>Server-side JavaScript extends the core language by supplying objects relevant to running JavaScript on a server. For example, server-side extensions allow an application to communicate with a database, provide continuity of information from one invocation to another of the application, or perform file manipulations on a server.</li>
          </ul>
        </p>
    </section>
    <section class="main-section" id="What_you_should_already_know">
      <header>
        <h2>What you should already know</h2></header>
      <p>This guide assumes you have the following basic background:</p>
      <ul>
        <li>A general understanding of the Internet and the World Wide Web (WWW).</li><br>
        <li>Good working knowledge of HyperText Markup Language (HTML).</li><br>
        <li>Some programming experience. If you are new to programming, try one of the tutorials linked on the main page about JavaScript.</li>
      </ul>
    </section>
     <section class="main-section" id="Hello_world">
       <header>
         <h2>Hello world</h2>
         </header>
       <p>To get started with writing JavaScript, open the Scratchpad and write your first "Hello world" JavaScript code:</p>
       <code>function greetMe(yourName) { alert("Hello " + yourName); }
greetMe("World");</code>
        <p>Select the code in the pad and hit Ctrl+R to watch it unfold in your browser!</p>
     </section>
      <section class="main-section" id="Variable_scope">
        <header>
          <h2>Variable scope</h2>
          </header>
        <p>When you declare a variable outside of any function, it is called a global variable, because it is available to any other code in the current document. When you declare a variable within a function, it is called a local variable, because it is available only within that function.</p>
        <p>JavaScript before ECMAScript 2015 does not have block statement scope; rather, a variable declared within a block is local to the function (or global scope) that the block resides within. For example the following code will log 5, because the scope of x is the function (or global context) within which x is declared, not the block, which in this case is an if statement.</p>
        <code>if (true) { var x = 5; } console.log(x); // 5</code>
        <p>This behavior changes, when using the let declaration introduced in ECMAScript 2015.</p>
        <code>if (true) { let y = 5; } console.log(y); // ReferenceError: y is
not defined</code></br>
      </section>
     <section class="main-section" id="Variables">
       <header>
         <<h2>Variables</h2>
         </header>
       <p>You use variables as symbolic names for values in your application. The names of variables, called identifiers, conform to certain rules.</p>
       <p>A JavaScript identifier must start with a letter, underscore (_), or dollar sign ($); subsequent characters can also be digits (0-9). Because JavaScript is case sensitive, letters include the characters "A" through "Z" (uppercase) and the characters "a" through "z" (lowercase).</p>
       <p>You can use ISO 8859-1 or Unicode letters such as å and ü in identifiers. You can also use the Unicode escape sequences as characters in identifiers. Some examples of legal names are Number_hits, temp99, and _name.</p>
     </section>
      <section class="main-section" id="Function_declarations">
        <header>
          <h2>Function declarations</h2>
          </header>
        <p>A function definition (also called a function declaration, or function statement) consists of the function keyword, followed by:</p>
        <ul>
          <li>The name of the function.</li><br>
          <li>A list of arguments to the function, enclosed in parentheses and separated by commas.</li><br>
          <li>The JavaScript statements that define the function, enclosed in curly brackets, { }.</li>
        </ul>
        <p>For example, the following code defines a simple function named square:</p>
        <code>function square(number) { return number * number; }</code>
        <p>The function square takes one argument, called number. The function consists of one statement that says to return the argument of the function (that is, number) multiplied by itself. The return statement specifies the value returned by the function.</p>
        <code>return number * number;</code>
        <p>Primitive parameters (such as a number) are passed to functions by value; the value is passed to the function, but if the function changes the value of the parameter, this change is not reflected globally or in the calling function.</p>
      </section>
     <section class="main-section" id="Global_variables">
       <header>
         <h2>Global variables</h2>
         </header>
       <p>Global variables are in fact properties of the global object. In web pages the global object is window, so you can set and access global variables using the window.variable syntax.</p>
       <p>Consequently, you can access global variables declared in one window or frame from another window or frame by specifying the window or frame name. For example, if a variable called phoneNumber is declared in a document, you can refer to this variable from an iframe as parent.phoneNumber.</p>
      </section>  

I’ve edited your code for readability. When you enter a code block into a forum post, please precede it with a separate line of three backticks and follow it with a separate line of three backticks to make it easier to read.

You can also use the “preformatted text” tool in the editor (</>) to add backticks around text.

See this post to find the backtick on your keyboard.
Note: Backticks (`) are not single quotes (').

1 Like

Failed: Each .main-section should have an id that matches the text of its first child, having any spaces in the child’s text replaced with underscores (_) for the id’s.

In this case the .main-section should have an id that matches the text of its first child.

The first child of .main-section should have a text, it should not have another nested element.

Its true that what you’re trying to do is to help the semantics by adding <header> elements, but thats not what the checker wants.

So try removing the <header> elements and go straight to <h2> as the first child of .main-section

Edit: I have tried it and it works

Thank you … the code passed

but new errow occurred it says " The first child of each .main-section should be a header element."

Well perhaps the first child should be <header> then not <h2> :confused:

alright i understand
thanks

This topic was automatically closed 182 days after the last reply. New replies are no longer allowed.