Add button to 1 Collection list item

I am trying to add a button to ONLY the very last collection list item (Catalog). How would I do that? When I do it adds it to all of them and I do not want that just to the last project item.


Here is my site Read-Only: https://preview.webflow.com/preview/damons-dapper-project-fc58f1?utm_medium=preview_link&utm_source=designer&utm_content=damons-dapper-project-fc58f1&preview=b0819b900883339ba33474657452c4bd&workflow=preview
(how to share your site Read-Only link)

hi @djgoss here is very simple example of one way how it can be done.

const collection = document.querySelector(".collection-list")
const lastItemContainer = collection.lastChild
const contentWrapper = lastItemContainer.firstChild

const btn = document.createElement("button");
btn.innerHTML= "Submit";
btn.type = "submit";
btn.name = "formBtn";
// ... etc...

wrapper.appendChild(btn)

btn.addEventListener("click", cbFunction)


const cbFunction = () => {
    // do your stuff
}