function createListComments(commentJson){
    const liElement = document.createElement('li');
    liElement.innerText = commentJson.comment;

    const deleteButton = document.createElement('button');
    deleteButton.innerText = 'Delete';
    deleteButton.addEventListener('click',() => {
        deleteComment(commentJson);
        liElement.remove();
    });

    liElement.appendChild(deleteButton);
    return liElement;
}
/** Creates an <li> element containing text. */
Creates an  element containing text.
Creates an element containing text .
function createListComments(commentJson){
    const liElement = document.createElement('li');
    liElement.innerText = commentJson.comment;
    const deleteButton = document.createElement('button');
    deleteButton.innerText = 'Delete';
    deleteButton.addEventListener('click',() => {
        deleteComment(commentJson);
        liElement.remove();
    });
    liElement.appendChild(deleteButton);
    return liElement;
}
function createListComments ( commentJson ) { const liElement = document . createElement ( 'li' ) ; liElement . innerText = commentJson . comment ; const deleteButton = document . createElement ( 'button' ) ; deleteButton . innerText = 'Delete' ; deleteButton . addEventListener ( 'click' , ( ) => { deleteComment ( commentJson ) ; liElement . remove ( ) ; } ) ; liElement . appendChild ( deleteButton ) ; return liElement ; }
Creates an <li> element containing text.
Creates an <li > element containing text .