Learn localStorage by Building a Todo App - Step 43

Tell us what’s happening: I keep on getting this error message and the code seems ok to me. Please help!!

Sorry, your code does not pass. You’re getting there.

You should set the ariaLabel of the addOrUpdateTaskBtn button to Update Task

Your code so far

const editTask = (buttonEl) => {
    const dataArrIndex = taskData.findIndex(
    (item) => item.id === buttonEl.parentElement.id

  currentTask = taskData[dataArrIndex];

  titleInput.value = currentTask.title;
  dateInput.value = currentTask.date;
  descriptionInput.value = currentTask.description;
  addOrUpdateTaskBtn.innerText = 'Update Task';
  addOrUpdateTaskBtn.setAttribute('aria-label', 'Update Task');


The challenge seed code and/or your solution exceeded the maximum length we can port over from the challenge.

You will need to take an additional step here so the code you wrote presents in an easy to read format.

Please copy/paste all the editor code showing in the challenge from where you just linked.

Replace these two sentences with your copied code.
Please leave the ``` line above and the ``` line below,
because they allow your code to properly format in the post.

Your browser information:

User Agent is: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/ Safari/537.36 Edg/

Challenge Information:

Learn localStorage by Building a Todo App - Step 43

Just use .ariaLabel to set the aria-label just as you have done with the innerText

Happy coding

1 Like

Thanks @opudoprince. I was researching the same issue and that worked. Just curious why the setAttribute() method is not working in this case - I’m assuming it’s because of the test script and it should normally work?

This topic was automatically closed 182 days after the last reply. New replies are no longer allowed.