Is there a way to revert back to the initial position after clicking?
I successfully changed the x icon to a + icon on click, but now I'm struggling to reverse that action. I've tried using MOUSEUP and DBLCLICK events, but they aren't ideal solutions. Also, if I use the CLICK event in =>firstLiI.addEventListener('click', start2); it overrides the initial logic.
const firstLiI = document.querySelector('li').children[0].children[0];
firstLiI.addEventListener('click', start1);
firstLiI.addEventListener('dblclick', start2);
//Event Handler
function start1(){
firstLiI.classList.add('fa-plus');
firstLiI.classList.remove('fa-remove');
}
function start2(){
firstLiI.classList.remove('fa-plus');
firstLiI.classList.add('fa-remove');
}