N
nyy
this program is supposed to give the user the ability to enter numbers
in cents and tell you how many dollars you have. PLease anybody can
tell me what's wrong. Thx.
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html>
<head>
<title>Cents to Dollars</title>
<script type="text/javascript">
<!-- HIDE FROM INCOMPATIBLE BROWSERS
function calcCents {
var cents = document.money.cents.value;
var dollars = 0;
var dollars = cents / 100;
var change = cents % 100;
if (change != 00)
window.alert("The number of cents you entered is equal to $" +
dollars + ".00");
else
window.alert("The number of cents you entered is equal to $" +
dollars);
}
// STOP HIDING FROM INCOMPATIBLE BROWSERS -->
</script>
</head>
<body>
<form name="money" action="">
<p>Cents: <input type="text" name="cents" /><br />
<input type="button" value="Cents to Dollars" onclick="calcCents();"
/></p>
</form>
</body>
</html>
in cents and tell you how many dollars you have. PLease anybody can
tell me what's wrong. Thx.
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html>
<head>
<title>Cents to Dollars</title>
<script type="text/javascript">
<!-- HIDE FROM INCOMPATIBLE BROWSERS
function calcCents {
var cents = document.money.cents.value;
var dollars = 0;
var dollars = cents / 100;
var change = cents % 100;
if (change != 00)
window.alert("The number of cents you entered is equal to $" +
dollars + ".00");
else
window.alert("The number of cents you entered is equal to $" +
dollars);
}
// STOP HIDING FROM INCOMPATIBLE BROWSERS -->
</script>
</head>
<body>
<form name="money" action="">
<p>Cents: <input type="text" name="cents" /><br />
<input type="button" value="Cents to Dollars" onclick="calcCents();"
/></p>
</form>
</body>
</html>