Technical Documentation Project Story #4

I have tried to look for other online solution since most people seems to run into this issue, I still haven’t found what is wrong. I get this error message while running the test. 4. 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”).

Here is my code please help:

Double check your IDs and innerText match correctly. I do not see a JavaScript & Java section in your file.

This one is tricky to pass though. I don’t know if it likes the ampersand symbol either.

1 Like

I think the problem is that for many elements with the class of “main-section” they do not have an id that matches the text in the header tag descendant from them. For example the "main-section element with id=“Hello_World” contains a header element containing the text Hello world in HTML. Clearly these do not match. For the test to pass each of these ‘pairs’ for every “main-section” must match, though clearly pairs shouldn’t match.

1 Like

Thank you so much, I finally got it work. Very useful advice.