connectedCallback(){consttemplate=`
<button class="countdown-start">Start the countdown</button>
<span class="seconds-left"></span>`;this.innerHTML=template;this.button=this.querySelector('.countdown-start');this.secondsDisplay=this.querySelector('.seconds-left');this.button.addEventListener('click',()=>this.handleClick());}
can be written
without HTML
without classes
without querySelector
without addEventListener
connectedCallback(){constcreateElement=(t,p={})=>Object.assign(document.createElement(t),p);this.append(this.button=createElement("button",{textContent:"Start the Countdown",onclick:()=>this.handleClick()}),this.secondsDisplay=createElement("span"));}
Top comments (0)
Subscribe
For further actions, you may consider blocking this person and/or reporting abuse
We're a place where coders share, stay up-to-date and grow their careers.
Top comments (0)