“Tarefa 1” Respostas de código

Tarefa 1

.container{
  display: flex;
  align-items: center;
  justify-content: center;
}

.input-box{
  height: 40px;
  width: 100px;
  border: 1px solid #ddd;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

button{
  background: transparent;
  border: 0;
  cursor: pointer;
  font-size: 15px;
  padding: 5px 10px;
}

p{
  padding: 5px 10px;
}
Nasty Newt

Tarefa 1

var counter = 0;

function plus() {
  counter += 1;
  document.getElementById("counter").innerHTML = counter;
}

function minus() {
  if(counter > 0){
    counter -= 1;
  }
  document.getElementById("counter").innerHTML = counter;
}
Nasty Newt

Tarefa 1

<div class="container">
  <div class="input-box">
    <button type="button" onclick="minus()" style="font-size: 20px;">-</button>
    <p id="counter">0</p>
    <button type="button" onclick="plus()">+</button>
  </div>
</div>
 Run code snippet
Nasty Newt

Respostas semelhantes a “Tarefa 1”

Perguntas semelhantes a “Tarefa 1”

Procure respostas de código populares por idioma

Procurar outros idiomas de código