function takeIt(ev) {
    const parentElement = ev.target.parentElement; // getting the p
    const inputField = parentElement.querySelector("input");
    const liElement = parentElement.parentElement;
    const button = ev.target;

    if (!inputField.value) {
      return;
    }
    button.textContent = "Checked";

    adoptedSection.appendChild(liElement);

    const spanElement = liElement.querySelector("span");
    spanElement.textContent = `New Owner: ${inputField.value}`;
    liElement.appendChild(spanElement);

    inputField.remove();
    button.remove();

    const checkButton = createEl("button", "Checked");
    liElement.appendChild(checkButton);

    checkButton.addEventListener("click", (ev) => {
      ev.target.parentElement.remove();
    });
  }
// when click the Check button - delete the list item
when click the Check button - delete the list item
when click the Check button - delete the list item
function takeIt(ev) {
    const parentElement = ev.target.parentElement; 
    const inputField = parentElement.querySelector("input");
    const liElement = parentElement.parentElement;
    const button = ev.target;
    if (!inputField.value) {
      return;
    }
    button.textContent = "Checked";
    adoptedSection.appendChild(liElement);
    const spanElement = liElement.querySelector("span");
    spanElement.textContent = `New Owner: ${inputField.value}`;
    liElement.appendChild(spanElement);
    inputField.remove();
    button.remove();
    const checkButton = createEl("button", "Checked");
    liElement.appendChild(checkButton);
    checkButton.addEventListener("click", (ev) => {
      ev.target.parentElement.remove();
    });
  }
function takeIt ( ev ) { const parentElement = ev . target . parentElement ; const inputField = parentElement . querySelector ( "input" ) ; const liElement = parentElement . parentElement ; const button = ev . target ; if ( ! inputField . value ) { return ; } button . textContent = "Checked" ; adoptedSection . appendChild ( liElement ) ; const spanElement = liElement . querySelector ( "span" ) ; spanElement . textContent = ` ${ inputField . value } ` ; liElement . appendChild ( spanElement ) ; inputField . remove ( ) ; button . remove ( ) ; const checkButton = createEl ( "button" , "Checked" ) ; liElement . appendChild ( checkButton ) ; checkButton . addEventListener ( "click" , ( ev ) => { ev . target . parentElement . remove ( ) ; } ) ; }
when click the Check button - delete the list item
when click the Check button - delete the list item
// getting the p