Front end certification: Drum Machine, 25 + 5 clock, JavaScript calculator

Hello everyone. I’ve been trying to do the projects in the topic above. I managed to get them running well on my device, also passed tests for the 25+5 clock when i ran them on my local device. However, when i put them on code pen and run tests, I get none of the tests right(for 25+5 clock) and only one right(for the other two projects). Please help me. 25+ 5: https://codepen.io/Evronz/pen/BaMJgMJ , Javascript Calculator: https://codepen.io/Evronz/pen/ZEwvdqw , DrumMachine: https://codepen.io/Evronz/pen/RwvxzLR .Any assistance is very welcome in advance.

Besides the above, I’ve failed to get the freecode camp test scripts to be visible in my random quote generator athttps://codepen.io/Evronz/pen/abXJVWG

Blockquote

if you change the import

import ReactDOM from "https://esm.sh/react-dom";

it will render the page…

1 Like

25 + 5 clock:

const audio = document.getElementById("beep");

You do not have this element in the HTML. So when you call .pause() it throws an error.

Uncaught TypeError: Cannot read properties of null (reading ‘pause’)


Calculator:

You are missing all the required ids.


Random Quote Machine:

Just add the test script to the settings as you did in the other Codepens.

Again, you are missing ids and you are not using the attribute correctly.

MDN: Global attributes id

An id 's value must not contain whitespace (spaces, tabs, etc.). Browsers treat non-conforming IDs that contain whitespace as if the whitespace is part of the ID. In contrast to the class attribute, which allows space-separated values, elements can only have one single ID value.

1 Like

Thank you for that. I did that and it rendered the pages.

Yes, you were right about the id attribute and audio element not being there for it to call. Thank you so much for reminding me.

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