HTML Programs



Q1:-Design a web page using different attributes of body.
<html>
<head>
<title>paragraph</title>
</head>
<body bgcolor="pink">
<h1><u><b><i><font size="8">search engine</font></i></b></u></h1>
<font color="red"><font face="monotype corsiva"><font size="6">
<p>
<b>
search engine are program that search documents for specified keywords and returns a list of the document<br></br>
where the keywords were found the term is often used to specifically describe system like google,bing,yahoo<br></br>
search that enable users to seach for document on the www.
</b>
</p>
</font>
</font>
</font>
</body>
</html>






Q2:-Design a web page page to create a  table having enroll,name and marks column.

<html>
<head><b><u><i><font size="6">student table</i></u></b></font></head>
<title>table</title>
<table border="9">
<tr>
<th>enrollment no</th>
<th>name</th>
<th>marks</th>
</tr>
<tr>
<td>01</td>
<td>vivek</td>
<td>95</td>
</tr>
<tr>
<td>02</td>
<td>vipin</td>
<td>94</td>
</tr>
<tr>
<td>03</td>
<td>ritika</td>
<td>90</td>
</tr>
<td>04</td>
<td>kajal</td>
<td>88</td>
</tr><tr>
<td>05</td>
<td>himanshu</td>
<td>89</td>
</tr><tr>
<td>06</td>
<td>jai</td>
<td>85</td>
</tr><tr>
<td>07</td>
<td>rohit</td>
<td>80</td>
</tr><tr>
<td>08</td>
<td>shikha</td>
<td>87</td>
</tr><tr>
<td>09</td>
<td>subiya</td>
<td>78</td>
</tr><tr>
<td>10</td>
<td>lino</td>
<td>77</td>
</tr>
</table>
</html>



Q3:-Design a web page to create a report card.

<html>
<head><b><u><i><font size="6">report card</i></u></b></font></head>
<title>table</title>
<table border="9">
<tr>
<th>enrollment no</th>
<th>name</th>
<th>subject</th>
<th>marks</th>
</tr>
<tr>
<td>01</td>
<td>vivek</td>
<td>pom</td>
<td>95</td>
</tr>
<tr>
<td>02</td>
<td>vipin</td>
<td>bcom</td>
<td>94</td>
</tr>
<tr>
<td>03</td>
<td>ritika</td>
<td>eco</td>
<td>90</td>
</tr>
<td>04</td>
<td>kajal</td>
<td>english</td>
<td>88</td>
</tr><tr>
<td>05</td>
<td>himanshu</td>
<td>web tech</td>
<td>89</td>
</tr><tr>
<td>06</td>
<td>jai</td>
<td>hindi</td>
<td>85</td>
</tr><tr>
<td>07</td>
<td>rohit</td>
<td>g.k</td>
<td>80</td>
</tr><tr>
<td>08</td>
<td>shikha</td>
<td>science</td>
<td>87</td>
</tr><tr>
<td>09</td>
<td>subiya</td>
<td>maths</td>
<td>78</td>
</tr><tr>
<td>10</td>
<td>lino</td>
<td>computer</td>
<td>77</td>
</tr>
</table>
</html>



Q4:-Design a form in html.
<html>
<head><u><i><b><font size="8">form</u></b></i></font></head>
<title>form</title>
<body>
<form method=post action="mail to:email id"enctype=text>
<table border="5" cell spacing="0" cell padding="6">
<tr>
<td colspan="10">
<font size="6" font face="monotype corsiva" font color="black">
<input type="text" name=url value="http://">:your url<br>
<input type="text" name="user name" font size="6">:user name<br>
<input type="text" name="email_id">:email_id
</font>
</td>
</tr>
<tr>
<td>
<input type="radio" name="subscribe" value="yes" checked>subscribe<br>
<input type="radio" name="unsubscribe" value="no">unsubscribe<br>
</font>
</td>
</tr>
</td>
<td colspan="10">
<font size="6" font face="monotype corsiva" font color="black">
<input type="check box" name="html" value="send me" checked><br>
i can receive email as html<br>
</font>
<text area cols="20" rows="30"><br>
hey!
what do you think of the form?
</text area><br>
<input name="redirect" type="hidden" value="index.htm"><br>
<input name="next_url" type="hidden" value="index.htm"><br>
<input type="submit" value="send"><br>
<input type="reset" value="clear">
</td>
</tr>
</table>
</form>



Q5:-Design a web page to create .
               Fruits
·         Apple
·         Mango
·         Grapes
·         Orange
·         Banana

          Birds
§  Sparrow
§  Pegion
§  Parrot
§  Crow
§  Peacock

             Vehicals
o   Jeep
o   Car
o   Truck
o   Auto
o   Motor bikes
<html>
<head><u><i><b><font size="7">fruits</u></b></i></font>
<title> fruits</title>
<body bgcolor="pink">
<font color="red" font size="6" font face="bradley hand ITC">
<ul>
<li>apple</li>
<li>orange</li>
<li>grapes</li>
<li>banana</li>
<li>lichi</li>
</ul>
</font>
<u><i><b><font size="7">birds</u></b></i></font>
<font color="blue" font size="6" font face="bradley hand ITC">
<ul type="square">
<li>crow</li>
<li>sparrow</li>
<li>pegion</li>
<li>eagle</li>
<li>ostrich</li>
</ul>
</font>
<u><i><b><font size="7">vehicles</u></b></i></font>
<font color="green" font size="6" font face="bradley hand ITC">
<ul type="circle">
<li>car</li>
<li>motar bike</li>
<li>truck</li>
<li>bus</li>
<li>auto</li>
</ul>
</font>
</body>
</html>



Q6:-Design a web page to create table using different attributes are cell  spacing,cell padding,border color etc.
<HTML>
<head>
<title>web page</title>
</head>
<body>
<table border="3" cellspacing="4" cellpadding="4" bgcolor="orange" bordercolor="black">
<tr>
<th colspan=2>PRODUCTIONS</th>
</tr>
<tr>
<th>books</th>
<th>Code</th>
</tr>
<td>java</td>
<td>124</td>
</tr>
<tr>
<td>.net</td>
<td>201</td>
</tr>
<tr>
<td>comic book</td>
<td>112</td>
</tr>
<th colspan=2>SALES</th>
<tr>
<th>books</th>
<th>Code</th>
<tr>
</tr>
<td>java</td>
<td>124</td>
</tr>
<tr>
<td>.net</td>
<td>201</td>
</tr>
<tr>
<td>comic book</td>
<td>112</td>
</tr>
</table>
</body>
</html>



Q7:-Insert an image in web page.
<html>
<head>
<title>attributes</title>
</head>
<body >
<img src="roy.jpg"</img>
</body>
</html>



Q8:-Design a web page to create a following.
Name of the students
<html>
<head><u><i><b><font size="7">name of students</u></b><i></font></head>
<title>name</title>
<body bgcolor="orange">
<font size="6" font color="black" font face="brush script M7">
<ul><ol type="1">
<li>himanshu</li>
<li>vipin</li>
<li>shweta</li>
<li>isha</li>
<li>suhail</li>
<li>subiya</li>
<li>rohit</li>
<li>jai</li>
<li>anurag</li>
<li>vipin</li>
</ol>
</ul>
</body>
</font>
</html>



Q9:-Write a code in javascript to print any name.
<html>
<body>
<title>Enter your name</title>
<font size="8">
<script language="javascript">
document.write("fade to black")
</script>
</font>
</body>
</html>



Q10:-write a program To calculate the sum of two numbers.

<html>
<body>
<title>Sum of two nos.</title>
<font size="8">
<script language="javascript">
var a,b,sum
a=prompt("Enter first no.")
b=prompt("Enter second no.")
sum=parseInt(a)+parseInt(b)
document.write("sum="+sum)
</script>
</font>
</body>
</html> 









Q11:-write a program to Calculate a square of a given number. 
<html>
<body>
<title>Square of a no.</title>
<font size="24">
<script language="javascript">
var a,square
a=prompt("Enter a no.")
square=(a*a)
document.write("square="+square)
</script>
</font>
</body>
</html>




Q12:-write a program to Calculate the area of a circle.
<html>
<body>
<title>Area of a circle</title>
<font size="24">
<script language="javascript">
var r,area
r=prompt("Enter the radius")
area=3.14*(r*r)
document.write("area="+area)
</script>
</font>
</body>
</html>





Q13:-write a program To print the concatinate of two strings.

<HTML>
<head>
<title>my web page</title>
</head>
<body>
<script language="Javascript">
var a,b,c;
a=prompt("Enter First Name");
b=prompt("Enter Second Name");
c=a+b;
alert("The concatinated string is:"+c);
</script>
</body>
</HTML>






Q14:-write a program to Check whether the number is positive or negative.

<html>
<body>
<title>Positive or negative</title>
<font size="24">
<script language="javascript">
i=prompt("Enter a no.")
{
if(i<0)
document.write("Number is negative")
else
document.write("Number is positive")
}
</script>
</font>
</body>
</html>




Q15:-write a program print grade using if and switch statement.
<html>
<title>Grade</title>
<body>
<font size="8">
<script language="javascript">
var a,grade
a=prompt("Enter the marks")
if(a>=90)
{
document.write("Grade A")
}
else if(a>=75)
{
document.write("Grade B")
}
else if(a>=60)
{
document.write("Grade C")
}
else
{
document.write("Grade D")
}
</script>
</font>
</body>
</html>




Q16:-write a program to print first 20 natural numbers using for loop.

<html>
<body>
<title>Natural nos.</title>
<font size="24">
<script language="javascript">
{
for(i=1;i<=20;i++)
document.write(i)
}
</script>
</font>
</body>
</html>



 Q17:-Write a code in java script which works on event handler.
<html>
<head>
<title>onfocus</title>
<script type="text/javascript">
function Apple()
{
alert("Focus is on Apple.");
}
function Orange()
{
alert("Focus is on Orange.");
}
</script>
</head>
<body>
<h1 style="color:black">Eg.of onFocus event handler</h1>
<form>
<input type="checkbox" name="checkbox1"
onfocus ="Apple()"/>Apple<br>
<input type="checkbox" name="checkbox2"
onfocus ="Orange()"/>Orange<br>
</form>
</body>
</html>





Q18:-write code to print number by using array and add them.

<html>
<title>Array sum</title>
<body>
<script>
var a,i,sum=0;
var m=new Array(50)
a=prompt("How many numbers you want to print?");
for(i=1;i<=a;i++)
{
m[i]=prompt("Enter number")
}
for(i=1;i<=a;i++)
{
sum=parseInt(sum)+parseInt(m[i])
}
document.write("sum="+sum)
</script>
</body>
</html>






Q19:-Write a code which returns number of forms.

<html>
<title>Forms</title>
<body>
<form name="form1">HTML</form><br>
<form name="form2">CSS</form><br>
<script>
document.write(document.forms.length)
</script>
</body>
</html>




1 comment:

FEEDBACK

Name

Email *

Message *