Hi another newbie here
I am trying to get the message: The you entered is a leap year, but it does not happen, what did I do wrong with this script?
<html>
<HEAD>
<SCRIPT LANGUAGE="JavaS cript">
<!--hide from old browsers
function test(){
if ((parseInt(docu ment.getElement ById("year")) % 4 == 0)&&
((parseInt(docu ment.getElement ById("year")) % 100 != 0)||
((parseInt(docu ment.getElement ById("year")) % 400 == 0))))
alert("The year you entered is a Leap Year")
else {
alert("The year you entered is a standard year");
}
}
//stop hiding from old browsers-->
</script>
</HEAD>
<BODY>
<form name="result">
<INPUT type="text" id="year"><p>
<INPUT type= "submit" name="button" value="Check for Leap Year" onClick="test() "><p>
</form>
</body>
</html>
I am trying to get the message: The you entered is a leap year, but it does not happen, what did I do wrong with this script?
<html>
<HEAD>
<SCRIPT LANGUAGE="JavaS cript">
<!--hide from old browsers
function test(){
if ((parseInt(docu ment.getElement ById("year")) % 4 == 0)&&
((parseInt(docu ment.getElement ById("year")) % 100 != 0)||
((parseInt(docu ment.getElement ById("year")) % 400 == 0))))
alert("The year you entered is a Leap Year")
else {
alert("The year you entered is a standard year");
}
}
//stop hiding from old browsers-->
</script>
</HEAD>
<BODY>
<form name="result">
<INPUT type="text" id="year"><p>
<INPUT type= "submit" name="button" value="Check for Leap Year" onClick="test() "><p>
</form>
</body>
</html>
Comment