Create modal window for marketplace items

I’m trying to create a modal window for the marketplace items but nothing is popping up. I followed the tutorial and used the repository provided on github. I created a button on the navigation bar <a class="nav-link" id="btnMarketPlace" href="#">Marketplace</a> on the navigation bar which links to const openRenderItemButton = document.getElementById("btnMarketPlace"); openRenderItemButton.onclick = renderItem;

renderItem = (item) => {
    const itemForSale = marketplaceItemTemplate.cloneNode(true);
    if (item.sellerAvatar){
        itemForSale.getElementsByTagName("img")[0].src = item.sellerAvatar.url();
        itemForSale.getElementsByTagName("img")[0].alt = item.sellerUsername;

    itemForSale.getElementsByTagName("img")[1].src = item.image;
    itemForSale.getElementsByTagName("img")[1].alt =;
    itemForSale.getElementsByTagName("h5")[0].innerText =;
    itemForSale.getElementsByTagName("p")[0].innerText = item.description;

    itemForSale.getElementsByTagName("button")[0].innerText = `Buy for ${item.askingPrice}`;
    itemForSale.getElementsByTagName("button")[0].onclick = () => buyItem(item); = `item-${item.uid}`;  $('#userItems').modal('show');

I added the modal just below of itemsForSale.appendChild(itemsForSale) 


But no modal or items are showing up. Can someone guide me with this please...

did you try to add some debugging with console.log to see if that function gets called, if the data is the expected data?