Technical Documentation Page - Build a Technical Documentation Page

I’ve been working with this project for a little bit now, and I still can’t figure out what’s going on.

The tests I’m still failing are

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.


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).

<!DOCTYPE html>
<html lang="en">
        <meta name="viewport" content="width=device-width, initial-scale=1.0">
        <meta charset="utf-8" />
        <link rel="stylesheet" href="./styles.css"/>

        <nav id="navbar">
            <header>JavaScript Documentation</header>
                <a href="#javascript_introduction" class='nav-link'>javascript introduction</a>
                <a href="#javascript_and_java" class='nav-link'>javascript and java</a>
                <a href="#hello_world" class='nav-link'>hello world</a>
                <a href="#variables" class='nav-link'>variables</a>
                <a href="#declaring_variables" class='nav-link'>declaring variables</a>
                <a href="#data_types" class='nav-link'>data types</a>
        <main id="main-doc">
        <section class="main-section" id="javascript_introduction">
            <header>javascript 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>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:</p>

                <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>


        <section class="main-section" id="javasript_and_java">
            <header>javascript and java</header>

            <p>JavaScript and Java are similar in some ways but fundamentally different in some others. The JavaScript language resembles Java but does not have Java's static typing and strong type checking. JavaScript follows most Java expression syntax, naming conventions and basic control-flow constructs which was the reason why it was renamed from LiveScript to JavaScript.</p>
            <p>In contrast to Java's compile-time system of classes built by declarations, JavaScript supports a runtime system based on a small number of data types representing numeric, Boolean, and string values. JavaScript has a prototype-based object model instead of the more common class-based object model. The prototype-based model provides dynamic inheritance; that is, what is inherited can vary for individual objects. JavaScript also supports functions without any special declarative requirements. Functions can be properties of objects, executing as loosely typed methods.</p>
            <p>JavaScript is a very free-form language compared to Java. You do not have to declare all variables, classes, and methods. You do not have to be concerned with whether methods are public, private, or protected, and you do not have to implement interfaces. Variables, parameters, and function return types are not explicitly typed.</p>


        <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>
                "function greetMe(yourName) { alert("Hello " + yourName); }
            <p>Select the code in the pad and hit Ctrl+R to watch it unfold in your browser!</p>

        <section class="main-section" id="variables">
            <header id="variables">Variables</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 class="main-section" id="declaring_variables">
            <header>declaring variables</header>
                <p>You can declare a variable in three ways:</p>
                <p>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.</p>
                <p>By simply assigning it a value. For example,</p>
                    <code>x = 42;</code>
                <p>This always declares a global variable. It generates a strict JavaScript warning. You shouldn't use this variant.</p>
                <p>With the keyword let. For example,</p>
                    <code>let y = 13;</code>
                    <code>const y = 23;</code>
                <p>This syntax can be used to declare a block scope local variable. See Variable scope below.</p>

        <section class="main-section" id="data_types">
            <header>data types</header>
            <p>The latest ECMAScript standard defines seven data types:</p>
            <li>Six data types that are primitives:</li>
                    <li>Boolean. true and false</li>
                    <li>null. A special keyword denoting a null value. Because JavaScript is case-sensitive, null is not the same as Null, NULL, or any other variant.</li>
                    <li>undefined. A top-level property whose value is undefine</li>
                    <li>Number. 42 or 3.14159.</li>
                    <li>String. "Howdy"</li>
                    <li>Symbol (new in ECMAScript 2015). A data type whose instances are unique and immutable.</li>
            <li>and Object</li>


    <script src=""></script>


Your browser information:

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

Challenge: Technical Documentation Page - Build a Technical Documentation Page

Link to the challenge:

@nslee333 I can see some error here in your html structure…You already specified an id for variable, why are you specifying another id for variable again??Well that’s the reason why it won’t pass the challenge…

 <section class="main-section" id="variables">
            <header id="variables">Variables</header>

Cancel the id under the header section and place the text variable inside the header element without specifying any id for it

There’s a typo on the id javascript is spelt wrong.

Perfect thank you, that fixed one of the errors.

Perfect thank you, that fixed the other error.

Thanks again guys, I got it passed, thanks so much.

1 Like

@Happy coding :laughing: :laughing: :laughing: :laughing: