scrimba
Note at 2:28
Go Pro!Bootcamp

Bootcamp

Study group

Collaborate with peers in your dedicated #study-group channel.

Code reviews

Submit projects for review using the /review command in your #code-reviews channel

Note at 2:28
AboutCommentsNotes
Note at 2:28
Expand for more info
index.js
run
preview
console
const inputText = document.querySelector('#string');
const counter = document.querySelector('#counterFooter');
const tweetButton = document.querySelector('#btn');
let count = 0;

inputText.addEventListener('input', function(e){
count = inputText.value.length;
counter.innerText = (`${140 - count}/140`)
if(count >= 120){
counter.classList.add('redText');
} else {
counter.classList.remove('redText');
}

if(count > 140){
tweetButton.classList.add('buttonDisabled');
} else {
tweetButton.classList.remove('buttonDisabled');
}
})
Console
/index.html
LIVE