Hi!
Could you give me an assessment on the task
Here is my files
and how it looks
Thank you!
Great work, @DiYuriivna
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
htmlFor
-
class
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 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 Like