The possible way to fix your code is to make sure your script tag (<script src="https://cdn.freecodecamp.org/testable-projects-fcc/v1/bundle.js"></script>) is at the last line of your code.
You should also ensure the script tag is not nested in another tag in your code.
Hey, thanks for the reply.
I did as you mentioned but still doesn’t work in codepen environment, though when I exported the project and run the file locally it worked. So the problem is manageably fixed. Thanks again !!