Hello my friend out there i realy need help .i'm working on one of my class labs but things is not that write to me...could one out there assist me thanks you. here is the quz<<<<<< Write a program in HTML and JavaScript for the following tasks: Find the maximum number of entries in the three-digit number.<<<<< here is my code but its not that working well help!!

<html>
<body>
<form name="form1">
<script type="text/JavaScript">
<!--
function maxValue(x,y,z)
var x,y,z;
if(x>y)

<html>
<body>
<form name="form1">
<script type="text/JavaScript">
<!--
function maxValue(x,y,z)
var x,y,z;
if(x>y)
{
if(x>z)
{
"x-Maximum number";
}
else{
"z-Maximum number";
}}
else{
if(y>z)
{
"y-Maximum number";
}
else{
"z-Maximum number";
}}}
//-->
</script>
Enter the Number<input type="text" size =3 name="num"> <br>
<input type="button" value="Check the maximum number of" onClick="maxValue

(form1)"><br>
Result:<input type="text" size =75 name="res"><br>
<input type="reset">
</form>
</body>
</html>

Well, your script does neither read anything from the HTML element nor return/write the result to anything.

First, the script must read in the value of those 3 number. You have only 1 input field (name="num") which would not be enough with your current implementation. Next for simplisity, you should have 3 input fields with different id/name for now. Then look up "getElementById()" function or "$" symbol because this is the way you read in the data from the current HTML page you are working on. Then inside your if-else statements would be to print out the result by placing it inside your input field (name "res"). That's all...

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.