Learn localStorage by Building a Todo App - Step 35

Tell us what’s happening:

Hi Everyone! I’m getting this error:
You should add onclick="editTask(this)" as the first attribute of the edit button.

Your code so far

 <button type="button" class="btn" onclick="editTask(this)">Edit</button>
          <button type="button" class="btn" onclick="deleteTask(this)">Delete</button>


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 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/ Safari/537.36

Challenge Information:

Learn localStorage by Building a Todo App - Step 35

I’ve edited your code for readability. When you enter a code block into a forum post, please precede it with a separate line of three backticks and follow it with a separate line of three backticks to make it easier to read.

You can also use the “preformatted text” tool in the editor (</>) to add backticks around text.

See this post to find the backtick on your keyboard.
Note: Backticks (`) are not single quotes (').

you put it as the third attribute, not as the first. Move the onclick attribute to be the first after the element name

1 Like

Thank you! so sorry! First time posting. Me not being able to follow the instructions on how to post and also how to read the steps in the task. (I’ve just re-read and noticed the word first ) .

Since we’re here, what’s the difference between adding it at first and my attempt at writing that bit of code?

Also, I’m quitting for today :slight_smile:
Thank you!

it’s a requirement for the tests, as code being written both ways are correct

I still have error even though I put onclick attribute first. Here is my code:


Hey there, please open your own topic to ask for help!