0
HTML
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Document</title>
</head>
<body>
<input type="text" id="entrada" placeholder="Nome">
<input type="button" value = "Iniciar"onclick = "botao()">
<input type="text" id="entrada2" placeholder="nota">
<ul id="tabela">
<li id="NotaMaior"></li>
<li id="NotaMenor"></li>
</ul>
<script src="JavaScript.js"></script>
</body>
</html>
Javascript
"use strict"
let maior = 0
let menor = 0
function botao() {
tabela.innerHTML +=
`<tr>
<td> ${entrada.value} </td>
<td> ${entrada2.value}</td>
</tr>`
if (entrada2.value > maior) {
maior = entrada2.value
}
else if ((entrada2.value < menor) || (menor == 0)) {
menor = entrada2.value
}
NotaMaior.innerHTML += ` / Maior ${maior}`
NotaMenor.innerHTML += ` / Menor ${menor}`
}
I’m having trouble showing the biggest and the smallest, could you help me ? Grateful!
Fixed one of my problems, but now I have another problem. I added the following line in my code
javascript
if(Number(maior) < Number(menor)){
menor = maior
}

The smallest only takes a value less than 3, if just after 3 I type for example 1. the smallest were taking the smallest results and showing on the screen. Getting like this : larger : 1 // greater : 2 // greater : 3 . minor : 0 // minor : 1 // minor: 1 ..– Bruno Rodrigues