I've been trying to make a calculator with javascript. Whenever I select Pythagorean Theorem, then input the values that it is supposed to solve it returns NaN. I'm not sure why it doesn't return a value.
$(function() {
$('#aValue').hide();
$('#bValue').hide();
$('#cValue').hide();
$('#pythagoreanTheorem').click(function() {
$('#aValue').show();
$('#bValue').show();
$('#cValue').show();
$('#resultButton').click(function() {
var aValue = document.getElementById("aText");
var bValue = document.getElementById("bText");
var result = (aValue*aValue)+(bValue*bValue)
$('#result').text(result);
});
});
});
function dropDownBox() {
document.getElementById("myDropdown").classList.toggle("show");
}
function filterFunction() {
var input, filter, ul, li, a, i;
input = document.getElementById("myInput");
filter = input.value.toUpperCase();
div = document.getElementById("myDropdown");
a = div.getElementsByTagName("a");
for (i = 0; i < a.length; i++) {
if (a[i].innerHTML.toUpperCase().indexOf(filter) > -1) {
a[i].style.display = "";
} else {
a[i].style.display = "none";
}
}
}