- Notifications
You must be signed in to change notification settings - Fork894
Open
Description
Hi, I'm trying to find a solution for images and the mandatoryalt attribute. And also for even more attributes likearia-labelledby. Thelist.on() function has no listener for onbuild. That's my first problem. I'd like to have an event for after mounted.
If I useon 'updated' my callback function for altering thealt attribute shows success in the console.log but the real list doesn't reflect the changes in the DOM.
Part of the function:
items.forEach((item)=>{constname=item.getElementsByClassName("personname")[0].innerText;constalt=`Potrait von${name}`;constimage=item.getElementsByClassName("portrait")[0];image.alt=alt;console.log("image with new alt:",item,image.alt);});
I'm using the HTML template similar to this example from the website:
<divstyle="display:none;"><!-- A template element is needed when list is empty, TODO: needs a better solution --><liid="hacker-item"><h3class="name"></h3><pclass="city"></p></li></div>
Maybe this doesn't work in this case?
Metadata
Metadata
Assignees
Labels
No labels