Help me passing user story #4 and #12

What is your hint or solution suggestion?

https://codepen.io/ridabatool/pen/oNZxOZM
I cant pass this test and I don’t know why :upside_down_face:

Challenge: Build a Technical Documentation Page

Link to the challenge:

User Story #4: Each section element with the class of main-section should also have an id that corresponds with the text of each header contained within it. Any spaces should be replaced with underscores (e.g. The section that contains the header “JavaScript and Java” should have a corresponding id="JavaScript_and_Java" ).

Your failing test says:

  1. Each element with the class of “main-section” should also have an id comprised of the innerText contained within it, with underscores in place of spaces. The id may include special characters if there are special characters in the respective innerText. (e.g. The that contains the header, “JavaScript & Java”, should have a corresponding id=“JavaScript_&_Java”).

Some “main-section” elements are missing the following ids (don’t forget to replace spaces with underscores!) : WHAT_YOU_SHOULD_ALREADY_KNOW,JAVASCRIPT_AND_JAVA,HELLO_WORLD,DECLARING_VARIABLES,VARIABLE_SCOPE,GLOBAL_VARIABLES,DATA_TYPES,IF…ELSE_STATEMENTS,WHILE_STATEMENTS,FUNCTION_DECLARATIONS : expected 10 to equal 0 AssertionError: Some “main-section” elements are missing the following ids (don’t forget to replace spaces with underscores!) : WHAT_YOU_SHOULD_ALREADY_KNOW,JAVASCRIPT_AND_JAVA,HELLO_WORLD,DECLARING_

When I look at one of those, I see:

<section id="What-you-should-already-know" class="main-section">
  <header>What you should already know</header>

Notice that you were told to use underscores and you’ve used hyphens. Computers aren’t really good at, “close enough, I know what he was thinking”.


For the other error that is failing:

  1. Each element with the class of “nav-link” should contain text that corresponds to the text within each (e.g. if you have a “Hello world” section/header, your navbar should have an element which contains the text “Hello world”).

Check that these headers have corresponding .nav-link elements and be mindful of case! : FUNCTION DECLARATIONS : expected 1 to equal 0 AssertionError: Check that these headers have corresponding .nav-link elements and be mindful of case! : FUNCTION DECLARATIONS : expected 1 to equal 0

When I look at the code:

    <li><a class="nav-link" href="#Functions-decleration">Functions decleration</a></li>

and

    <section id="Functions-decleration" class="main-section">
      <header>Function declarations</header>

I see that you are having a hard time deciding which word should be plural and what spelling of “declaration” you want to use.


I suspect that if you fix all of that, you will have better luck.

1 Like

gladly I passed the test…I was having some spelling issues :slightly_smiling_face:

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