3rd Code

 <!DOCTYPE html>


<html>

<head>

<title> Form Elements and Attributes </title>

<style> //format and styles

   div {

     margin-bottom: 100px;

   {

   label {

     display: inline-block;

     width: 200px;

   }

   fieldset {

     background: #e1eff2;

   }

   legend {

     padding: 2px 0;

     font-size: 20px;

   }

p{

     display: inline-block;

     width:1000px;

   }


<script>

function display ()

{

fname=document.getElementById("fname").value; //get the input name in the textbox fname

grade=document.getElementById("grade").value; //get the input grade in the textbox grade

document.getElementById("demo").innerHTML = "Name " + fname + "<br> grade :" +grade;

// display name and age in the paragraph demo...

if (grade <=100 && grade>=98)

remarks = "<font color=violet size=20> Remarks : Excellent 1.00 " ;

else if(grade<=97 && grade>=90)

remarks = "<font color=green size=20> Remarks : Very Good 1.25 " ;

else if (grade<=93 && grade>=90)

remarks = "<font color=green size=20> Remarks : Satisfactory 1.50 " ;

else

remarks = "<font color=red size=20> Sorry You failed! </font>" ;

document.getElementById("demo2").innerHTML = "<br> Remarks :" +remarks; //display the remarks in another paragraph demo2

}

</script>

</body>

</html>

Comments

Popular Posts