Skip to content

Instantly share code, notes, and snippets.

@diessica
Last active December 22, 2015 23:09
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save diessica/6545115 to your computer and use it in GitHub Desktop.
Save diessica/6545115 to your computer and use it in GitHub Desktop.
function verificar() {
var dados = document.getElementById("dados"),
t1 = document.getElementById("t1").value,
t2 = document.getElementById("t2").value,
t3 = document.getElementById("t3").value;
if (t1 == t2 && t2 == t3 && t1 == t3) {
dados.triangulo.value = "Isosceles";
}
else if (t1 == t2 || t2 == t3) {
dados.triangulo.value = "Equilatero";
}
else {
dados.triangulo.value = "escaleno";
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment