Wednesday, March 28, 2018

How To Find Minimum No In JavaScript.

<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<title>Untitled Document</title>
<script language="javascript">
function valid()
{
   var i=parseInt(document.niks.txta.value);
   var j=parseInt(document.niks.txtb.value);
    if (i>j)
  {
           alert("min is="+j);
}
else
  {
      alert("min is="+i);
    }
}

</script>
</head>

<body>
<form name="niks">
enter value of a=<input type="text" name="txta" /></br>
enter value of b=<input type="text" name="txtb" /></br>
<input type="button" value="submit" name="btnsub"  onclick="valid();"/>
</form>

</body>
</html>

No comments:

Post a Comment

Generate Even Numbers in a Range In PHP.

$start = 1; $end = 20; for ($i = $start; $i <= $end; $i++) {     if ($i % 2 == 0) {         echo $i . " is even.<br>";   ...