- Image gallery - ASSESSMENT

Hi!
Could you give me an assessment on the task
Here is my files
and how it looks
Thank you! :slightly_smiling_face:

Great work, @DiYuriivna :medal_sports:

Everything is coded correctly. I just have one comment, that will make the code simpler:
Instead of getAttribute() and setAttribute() we can also use dot notation. For example, displayedImage.setAttribute('src', source); becomes displayedImage.src = source;.

Just be aware that there are two HTML attribute that have different names in JS:

  • for :arrow_right: htmlFor
  • class :arrow_right: className

As an additional question: Can you guess why they have different names?

Cheers,
Michael

1 Like

Thank you, @MikoMI! Dot notation greatly simplifies the code :heart_eyes: Thanks for another helpful tip )
I think the HTML “for” and “class” attributes have different names in JS because they are JavaScript reserved words.

1 Like

Great improvements. Now the code looks much simpler.

That’s exactly right. :+1:

1 Like