I have created a page that is used to track daily tasks. A button is pressed and a new task is created. Within these new tasks, none of the code I have written applies to them as it only appears to work on the tasks that already exist.

Is there a way to reparse/ re-run the code so it recognizes newly created elements and allows them to function?

```
//This is the card that represents a task..'Finish' button is what I am having the issues with.
<section id="active-projects">
      <header>
        <h2>Active Projects</h2>
      </header>
      <ul id = 'active'>
        <li
          id="p1"
          data-extra-info="Got lifetime access, but would be nice to finish it soon!"
          class="card"
        >
          <h2>Finish the Course</h2>
          <p>Finish the course within the next two weeks.</p>
          <button class="alt">More Info</button>
          <button>Finish</button>
        </li>

```

```
//This is the logic that creates a new button by cloning the cards and then applying an event listener that moves it to the finished column upon clicking

createNew () {
    const newClnIds = [];
    const newItem = document.getElementById('active').querySelector('li');
    const cln = newItem.cloneNode(true);
    cln.id = "p" + (document.querySelectorAll("#active > li").length + 1);
    let clnId = cln.id;
    document.getElementById('active').appendChild(cln);

    //Selects the Finish Button in the New Cloned Element and adds eventlistener to move it to the finished projects column when clicked.

    const clnButton = cln.querySelector('button:last-of-type');
    clnButton.addEventListener("click", function() {DOMHelper.moveElement(cln.id, "#finished-projects ul");

```

```
//This is the function that switches the button from 'Finished' to 'Active'. Pressing 'Finished' moves the card to the 'Active' column and pressing 'Actvive' Button moves it to finished. My new elements will not have the button switch types when pressed to move columns. 

connectSwitchButton(type) {
    const projectItemElement = document.getElementById(this.id);
    let switchBtn = projectItemElement.querySelector('button:last-of-type');
    switchBtn = DOMHelper.clearEventListeners(switchBtn);

    switchBtn.textContent = type === 'active' ? 'Finish' : 'Activate';
    switchBtn.addEventListener(
      'click', 
      this.updateProjectListsHandler.bind(null, this.id)
    );
  }

```

```
//This is in a Class that is first in my code and is the logic used to move the cards using append.

//receives element ID and a New destination in the DOM and sends the card to that destination Via Append.
  static moveElement(elementId, newDestinationSelector) {
    const element = document.getElementById(elementId);
    const destinationElement = document.querySelector(newDestinationSelector);
    destinationElement.append(element);

  }
}

```