Technical Documentation Page - Build a Technical Documentation Page

Tell us what’s happening:
I need help nothing seems to work.

  1. All of your .nav-link elements should be anchor (a ) elements.
  2. Each .nav-link should have text that corresponds to the header text of its related section (e.g. if you have a “Hello world” section/header, your #navbar should have a .nav-link which has the text “Hello world”).
  3. Each .nav-link should have an href attribute that links to its corresponding .main-section (e.g. If you click on a .nav-link element that contains the text “Hello world”, the page navigates to a section element with that id).
    I don’t know what am i doing wrong :frowning: please help!!
    Your code so far

WARNING

The challenge seed code and/or your solution exceeded the maximum length we can port over from the challenge.

You will need to take an additional step here so the code you wrote presents in an easy to read format.

Please copy/paste all the editor code showing in the challenge from where you just linked.
<!doctype html>

JS documentation
<body>
  <nav id="navbar">
  <header class="nav-link" id="navbar">JS Documentation</header>
        <ul>
          <li id="main-section"><a class="nav-link" href="#introduction">Introduction</a></li>
      <li><a class="nav-link" href="#what_should_you_already_know">What should you already know</a></li>
        <li><a class="nav-link" href="#hello_world">Hello World</a></li>
        <li><a class="nav-link" href="#declaring_variables">Declaring Variables</a></li>
        <li><a class="nav-link" href="#variable_scope">Variable Scope</a></li>
        <li><a class-"nav-link" href="#constants">Constants</a></li>
        <li><a class="nav-link" href="reference">Reference</a></li>
       <ul></nav>
Introduction

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.

  • 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.
  • 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.
  • What should you already know

    This guide assumes you have the following basic background:

    • A general understanding of the Internet and the World Wide Web (WWW)
    • Good working knowledge of HyperText Markup Language (HTML).

  <section class="main-section" id="hello_world">
    <header>Hello World</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”);

Select the code in the pad and hit Ctrl+R to watch it unfold in your browser!



Declaring Variables

You can declare a variable in three ways:
With the keyword var. For example,


var x = 42.

This syntax can be used to declare both local and global variables.

By simply assigning it a value. For example,


x = 42.

Variable scope

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.


if (true) { var x = 5; } console.log(x); // 5

Constants

You can create a read-only, named constant with the const keyword. The syntax of a constant identifier is the same as for a variable identifier: it must start with a letter, underscore or dollar sign and can contain alphabetic, numeric, or underscore characters.

const PI = 3.14;

        <section class="main-section" id="reference">
          <header>Reference</header>
          <p><ul><li>All the documentation in this page is taken from <a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Guide">MDN</a></li></ul></p></section>
</html **Your browser information:**

User Agent is: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/112.0.0.0 Safari/537.36

Challenge: Technical Documentation Page - Build a Technical Documentation Page

Link to the challenge:

SORRY it’s my first time posting something here.
Kindly someone help me with this code I am getting 3 wrong mentioned above

<html lang="en">
  <head>
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, initial scale 1=0">
    <title>JS documentation</title>
    <link rel="stylesheet" href="styles.css">
    </head>

    <body>
      <nav id="navbar">
      <header class="nav-link" id="navbar">JS Documentation</header>
            <ul>
              <li><a class="nav-link" href="#introduction">Introduction</a></li>
          <li><a class="nav-link" href="#what_should_you_already_know">What should you already know</a></li>
            <li><a class="nav-link" href="#hello_world">Hello World</a></li>
            <li><a class="nav-link" href="#declaring_variables">Declaring Variables</a></li>
            <li><a class="nav-link" href="#variable_scope">Variable Scope</a></li>
            <li><a class-"nav-link" href="#constants">Constants</a></li>
            <li><a class="nav-link" href="reference">Reference</a></li>
           <ul></nav>

<main id="main-doc">
      <section class="main-section" id="introduction">
        <header>Introduction</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><ul><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>
<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></p>
      </section>
      <section class="main-section" id="what_should_you_already_know">
        <header>What should you already know</header>
        <p>This guide assumes you have the following basic background:</p><p><ul><li>A general understanding of the Internet and the World Wide Web (WWW)</li>
        <li>Good working knowledge of HyperText Markup Language (HTML).</li></ul></p>
        </section>
        
      <section class="main-section" id="hello_world">
        <header>Hello World</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="declaring_variables">
        <header>Declaring Variables</header>
        <p>You can declare a variable in three ways:
With the keyword var. For example,</p>
<code>var x = 42.</code>
        <p>This syntax can be used to declare both local and global variables.

By simply assigning it a value. For example,</p>
        <code>x = 42.</code></section>
      <section class="main-section" id="variable_scope">
        <header>Variable scope</header>
        <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></section>
      <section class="main-section" id="constants">
        <header>Constants</header>
        <p>You can create a read-only, named constant with the const keyword. The syntax of a constant identifier is the same as for a variable identifier: it must start with a letter, underscore or dollar sign and can contain alphabetic, numeric, or underscore characters.</p><code>const PI = 3.14;</code>
        </section>

            <section class="main-section" id="reference">
              <header>Reference</header>
              <p><ul><li>All the documentation in this page is taken from <a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Guide">MDN</a></li></ul></p></section>
 
          
</main>
</body>
 </html>```

Validate your HTML

https://validator.w3.org/nu/#textarea


All of your .nav-link elements should be anchor (a) elements.

Your code:

<header class="nav-link" id="navbar">JS Documentation</header

You should have the same number of .nav-link and .main-section elements.

Look closely at the class name value assignment

<li><a class-"nav-link" href="#constants">Constants</a></li>

Each .nav-link should have an href attribute that links to its corresponding .main-section…

Check the href value, it is missing something.

<li><a class="nav-link" href="reference">Reference</a></li>

OMG thank you soo much. I was about to cry :laughing:

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