HTML
1) Write a program using HTML with following specifications.
The background colour should be green. The text colour should be red.
The heading should be large in size as 'My First Web Page'. Display a horizontal line after the
heading.
Display your name in Bold, address in Italics and standard as 11th .
<!doctype html>
<html>
<head>
<title>Personal Details</title>
</head>
<body bgcolor=green text=red>
<h1>My First Web Page</h1>
<hr>
Name:<b>Amit Patel</b><br>
Address:<i>203 Raj Tower, Kandivali(West)</i><br>
Standard:11<sup>th</sup>
</body>
</html>
2) Create a webpage with following specification.
Display heading 'Application Form' in highest heading with center alignment.
Accept name, standard 11th or 12th with only one selection choice.
Submit the form.
<!doctype html>
<html>
<head>
<title>form</title>
</head>
<body>
<h1 align=center>Application Form</h1>
<form name=f1>
Enter Name:<input type=text name=t1><br>
Standard:
<input type=radio name=r1 value=1>11<sup>th</sup>
<input type=radio name=r1 value=2>12<sup>th</sup>
<br>
<input type=submit name=submit value=submit>
</form>
</body>
</html>
1
JAVASCRIPT
1) To check whether, user entered number is positive or negative
<!doctype html>
<html>
<head>
<title>Positive negative</title>
</head>
<body>
<script language=javascript>
n=parseInt(prompt("Enter a number"))
if(n>0)
document.write(n+" is positive")
else
document.write(n+" is negative")
</script>
</body>
</html>
2) To accept number and display square of it.
<!doctype html>
<html>
<head>
<title>Square</title>
</head>
<body>
<script language=javascript>
n=parseInt(prompt("Enter a number"))
document.write("The square of " + n + " is " + n*n)
</script>
</body>
</html>