portfolio/src/main/webapp/script.js
/** Creates an element containing user name, comment. */
Creates an element containing user name, comment.
Creates an element containing user name comment .
function createCommentElement(line) {
  const liElement = document.createElement('li');
  liElement.innerText = line.userName + ": " + line.text;
  return liElement;
}
function createCommentElement ( line ) { const liElement = document . createElement ( 'li' ) ; liElement . innerText = line . userName + ": " + line . text ; return liElement ; }
Creates an element containing user name, comment.
Creates an element containing user name comment .
//liElement.className = 'comment'; //const userNameElement = document.createElement('span'); //userNameElement.innerText = line.userName; //const textElement = document.createElement('span'); //textElement.innerText = line.text; //const timeElement = document.createElement('span'); //timeElement.innerText = line.timestamp; //liElement.appendChild(userNameElement); //liElement.appendChild(textElement); //liElement.appendChild(timeElement);