This is a program to just calculate a weekly gross salary based on the
hourly wage and hours worked (with overtime too). I am not getting the
alert box when it calculates it. Can anyone see what I might be doing
wrong? It is a smaller program so if someone could please help me
out!!
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtmll/DTD/xhtmll-transitional.dtd">
<html>
<head>
<title>Project 10-1</title>
<script type="text/javascript">
<!--HIDE FROM INCOMPATABLE BROWSERS
function grossSalaryCalc() {
if (document.wages.hoursWorked.value 40) {
var overHours = hoursWorked -
40;
var overPay = overHours * 1.5 *
hourlyWage;
var grossPay = (hourlyWage * 40) +
overPay;
alert("Your weekly gross salary is " +
grossPay);
}
else {
var grossPay = hourlyWage * hoursWorked;
alert("Your weekly gross salary is " + grossPay);
}
}
//STOP HIDING FROM INCOMPATIBLE BROWSERS -->
</script>
</head>
<body>
<form name="wages" action="" method="get">
<p><label for="hoursWorked">Hours Worked</label> <input
type="text" name="hoursWorked" id="hoursWorked" /></p>
<p><label for="hourlyWage">Hourly Wage</label> <input type="text"
name="hourlyWage" id="hourlyWage" /></p>
<p><button type="button" onclick="grossSalaryCalc()">Calculate Gross
Salary</button>
</p>
</form>
</body>
</html>