<html>
<body>
<script>
function find()
{
var sum=0;
var no=parseInt(frm.txt1.value);
while(no>0)
{
sum=sum+no%10;
no=Math.floor(no/10);
}
alert("Sumof Digits"+sum);
}
</script>
<form name="frm">
EnteraNumber:<input type="text"name="txt1" /><br>
<input type="button"name="b1"onclick="find();"value="Display"/>
</form>
</body>
</html>
<html>
<head> <style>
body{background-color:lavender;
text-align: center;}
h2{font-style:italic; font-size: 30px; color: #f08080;} p{font-size: 20px;}
.blue{color: blue;}
.red{color:red;}
.green{color:green;}
</style> </head>
<body>
<h3style="color:red;
font-style: italic; text-align:center;
font-size: 50px;
padding-top:25px;">LearningHTMLusingInline
CSS</h3>
<h2>LearningHTMLwithinternal
CSS</h2>
<pclass="blue">Thisisabluecolor
paragraph</p>
<pclass="red">Thisisaredcolorparagraph</p>
<pclass="green">Thisis
agreen colorparagraph</p>
</body>
</html>
Comments
Post a Comment