JS DOM element to an object literal

31 views Asked by At

I need a setTimeout that add a new class to the icon that you can see in my code, but I don't know how to create the DOM element for

 <i class="fa fa-check-double" id='icon'></i>
inputText.addEventListener("keypress", event => {
    if (event.key === "Enter") {
      event.preventDefault();
      chat.innerHTML += `<div class="ballon">
                            <div>${inputText.value}</div>
                            <span class="time">
                                ${today.getHours()}:${today.getMinutes()}
                                <i class="fa fa-check-double" id='qui'></i>
                            </span>
                          </div>  
                         `
      inputText.value = ''
    }
})

I don't know how to create the DOM variable that I need, I'm a newbie of course

0

There are 0 answers