@sahand-masoleh
Posted
Hey Nick! Nice job!
First off, don't use in-line HTML event handlers (e.g. <button onclick="someFunction()" />
), they are deprecated, see here. Use your JavaScript to listen for the click event and run the function that you want.
This also answers your last question I believe, inside that function toggle CSS classes with animations that you want for the desired elements. I hope I understood your question correctly.
As for loading data with JS, you normally use the fetch API to pull external data. But if your json is local and you're using a bundler, you can also import it like any other ES module.
Marked as helpful
@HarmoniaCodes
Posted
@sahand-masoleh Thank you so much for taking the time to review my code! Your feedback is very helpful. This is the first time I've tried to use Javascript, so I have a lot to learn. Thank you for giving me some areas to start with!
@sahand-masoleh
Posted
@HarmoniaCodes Oh wow, it's very brave of you to tackle a multi-page challenge as your first JS project. Kudos to you! But I would start with something easier. 😬