Failed test: Within #quote-box, I can see a clickable <a> element with corresponding id="tweet-quote"

So i m unable to pass the test #5 for the Random quote machine.

codepen link: https://codepen.io/mdsam211/pen/qBrPGRz

Error MSG:
#tweet-quote element is not a child of #quote-box : expected 3 to equal 1
AssertionError: #tweet-quote element is not a child of #quote-box : expected 3 to equal 1
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:153449)
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

I have no idea why this occurs even though #tweet-quote element is a child of #quote-box . any helps would be appriciated.

Two issues.

No.1:
You didn’t close out your i tag

<i class="fab fa-twitter-square fa-3x"></i

No.2:
You can’t have duplicate ids in html.
Get rid of the tweet-quote in the button.

 <button id="tweet-quote" onclick="myTweet()">

When I make those changes the test passes

1 Like

Thanks u are real one!
Duplication of Ids was the issue;

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