Build a Technical Documentation Page-Difficulty in passing User Story-13

Hi,
I am facing trouble to pass the USER STORY-13- When I click on a navbar element, the page should navigate to the corresponding section of the main-doc element (e.g. If I click on a nav-link element that contains the text “Hello world”, the page navigates to a section element that has that id and contains the corresponding header .

Link -https://codepen.io/sanjay-121/pen/vYxQOGE

Error shown-

13. When I click on a navbar element, the page should navigate to the corresponding section of the “main-doc” element (e.g. If I click on a “nav-link” element that contains the text “Hello world”, the page navigates to a element that has that id and contains the corresponding .

Every .nav-link should have an href value that links it to its corresponding .main-section (e.g. href="#Introduction"). Check that these .main-section ids have corresponding href values : javaScript_and_java : expected 1 to equal 0
AssertionError: Every .nav-link should have an href value that links it to its corresponding .main-section (e.g. href="#Introduction"). Check that these .main-section ids have corresponding href values : javaScript_and_java : expected 1 to equal 0
at Proxy.c (https://cdn.freecodecamp.org/testable-projects-fcc/v1/bundle.js:549:1889)
at Proxy.l (https://cdn.freecodecamp.org/testable-projects-fcc/v1/bundle.js:431:130)
at Function.n.strictEqual (https://cdn.freecodecamp.org/testable-projects-fcc/v1/bundle.js:574:655)
at a. (https://cdn.freecodecamp.org/testable-projects-fcc/v1/bundle.js:657:150211)
at https://cdn.freecodecamp.org/testable-projects-fcc/v1/bundle.js:598:38668
at i.g.run (https://cdn.freecodecamp.org/testable-projects-fcc/v1/bundle.js:598:38963)
at N.runTest (https://cdn.freecodecamp.org/testable-projects-fcc/v1/bundle.js:598:45686)
at https://cdn.freecodecamp.org/testable-projects-fcc/v1/bundle.js:598:46651
at o (https://cdn.freecodecamp.org/testable-projects-fcc/v1/bundle.js:598:45075)
at https://cdn.freecodecamp.org/testable-projects-fcc/v1/bundle.js:598:45145

Remove all unnecessary spaces and newlines from the code. Then try the test again.

<li><a class="nav-link" href="#javaScript_and_java">JavaScript and Java</a></li>

Thank you for sharing the tips.

I have cleared the extra spaces but still face failure in passing USER STORY#13

I don’t see any change in your code on Codepen.


Here is what I get when I clean it up.

Thank you for guiding me.
Now I have passed it.

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