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
if you change the import
import ReactDOM from "https://esm.sh/react-dom";
it will render the page…
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’)
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
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.
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.