Code:
<script language="javascript">
function xyz(){
var yr = document.frm.year.value;
if(yr%4==0){
document.getElementById('rst').innerHTML = "The givenyear is learyear";
}
else{
document.getElementById('rst').innerHTML = "The givenyear is not learyear";
}
}
</script>
<form name="frm">
<label>Enter the year</label>
<input type="text" name="year" />
<br />
<input type="button" value="Submit" onClick="xyz()" />
</form>
<div id="rst"></div>
Comments
Post a Comment