Geral
Fundamentos de Internet e Web
Semana 6
0

Questão

Suponha uma classe de estilo definida como: h1.class1{color:red}. A utilização dessa classe deve ser feita via: 

A)

<h1 class1=”class”>Texto</h1>

B)

<h2 color=”red”>Texto</h2> 

C)

<h1 class=”class1”>Texto</h1>

D)

<h1 ref=”class1”>Texto</h1>

E)

<h2 class=”class1”>Texto</h2>

function vote(questaoId, value) { window.location.href = "/accounts/login/?next=/questao/890/"; return; fetch(`/vote/questao/${questaoId}/`, { method: 'POST', headers: { 'Content-Type': 'application/json', 'X-CSRFToken': 'VTgokBXMw8M1ZlXzUh51ShtSQqR4AcPUU3w9UiyBtBygZKK9aSL62hq1VpQ9LXKU' }, body: JSON.stringify({ value: value }) }) .then(response => response.json()) .then(data => { if (data.success) { document.getElementById(`score-${questaoId}`).textContent = data.score; const upBtn = document.querySelector(`button[onclick="vote(${questaoId}, 1)"]`); const downBtn = document.querySelector(`button[onclick="vote(${questaoId}, -1)"]`); upBtn.classList.remove('active-up'); downBtn.classList.remove('active-down'); if (data.user_vote === 1) upBtn.classList.add('active-up'); if (data.user_vote === -1) downBtn.classList.add('active-down'); } }); }