Coding Class Exam

<html>

<head>

<title></title>

<script>

function parity()

{

x=frm1.no1.value;

x=parseInt(x);

if (x%2==0)

document.getElementById("result").innerHTML="The Number Is:Even";

else 

document.getElementById("result").innerHTML="The Number Is:Odd";

}

</script>

<style>

body

{

margin-left:37%;

margin-right:37%;

margin-top:20%;

background-color:#9f92f7;


}

form

{

background-color:#36eeff;

padding:30px;


}

#hi

{


width:300px;

height:40px;

background-color:#36eeff;

}

#btn

{

width:300px;

height:50px;

background-color:#9f92f7;

border:none;

font-size:20px;

}

</style>

</head>

<body>

<form name=frm1>

NUMBER:</br></br><input type=text name=no1 id=hi placeholder="Enter Your Number"></br><br>

<input type=button value="Submit" onclick="parity()" id=btn><br></br><br>

<span id=result>The Number Is:</span>

</form>

</body>

</html>

1 comment:

  1. Yes Correct Eshaa

    Your logical and designing skills are so good ...Well done.

    ReplyDelete