Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
0% found this document useful (0 votes)
9 views

html java script program (1)

Java program

Uploaded by

khatryshaurya9
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
9 views

html java script program (1)

Java program

Uploaded by

khatryshaurya9
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 12

HTML

1. Write a program using html with following CSS specification

(1) The background colour of the company name should be in green.


(2) The text colour of the company name should be red.
(3) The heading should be large with font "comic sans ms"
(4) The description of the company should be displayed in blue color in a paragraph.

2. Write Html5 code with CSS as follows:


1. Create form to accept name,age, email address, from the user.
2. Create a submit buttgbbbh ,on to send the data.
3. The heading of the form should have a background colour and a different font style.

3.Write Html5 code with CSS as follows:

1. Create ordered list with names of tourist Cities.


2. Create unordered list with tourist PLACES of those cities.
3. Divide the list into two sections left and right by using CSS.

4.Design a web page that should accept Personal Details of the user i.e. name of the user
along with date and time values. The Page must contain submit button.

5. Design a web page that should accept name of the user, Email ID, Number of years
completed in office, Office phone number(compulsory), image with submit button.

6. Design a web page that should accept name of the user, select file for upload, color
picker tool, website URL, search and submit button.

7.Write a program using html with following CSS specifications :

(a) The background color of the College name should be in red color.
(b) The text color of the College name should be yellow color.
(c) The description of the college should be paragraph with right align.
8.Write a program using html with following CSS specifications:
(a) The page should contain heading as XII IT in blue color
(b) Create Unordered List of topics in IT
(c)Change the font to comic Sans

9. Write a program using html with following CSS specifications :

(a) To create a form that should accept name, age, date of appointment from the user
(b) Create submit button to send the data.
(c) The heading of the form should have orange background color with different font style

10.Write a program using html with following CSS specifications :


(a) To create a form that should accept name, number of present students (compulsory),
time and file to upload from the user
(b) Create submit button to send the data.
(c) The heading of the form should have border with blank spaces around the contents

11. Write a program using html with following CSS specifications :

(a) To create a form that should accept name, contact number of office (compulsory),
month, number of years completed (between 1-30) from the user.
(b) Create submit button to send the data and refresh button to reload the
(c) The heading of the form should have border, text color should be red. Page.

12. Write a program using html to create inline frame. It should contain image.
Javascript

1. Display Addition, substraction, multiplication, division of two numbers, which were


accepted from user.

<!DOCTYPE html>
<html lang="en">
<head>
<title>Document</title>
<script type="text/javascript">
var a, b;
a = parseInt(prompt("Enter value of a:"));
b = parseInt(prompt("Enter value of b :"));
var z = a + b;
document.write("<br>Addition :" + z); //2010
var z = a - b;
document.write("<br>Subtraction :" + z);
var z = a / b;
document.write("<br>Division :" + z);
var z = a * b;
document.write("<br>Multiplication :" + z);
</script>
</head>
<body></body>
</html>
2. Find and display factorial of given number.
<!DOCTYPE html>
<html>
<head>
<title>Document</title>
<script type="text/javascript">
var a=4;
var fact=1;
for(var i=1;i<=a;i++){//5
fact=fact*i; // 6*4=24
}
document.write("Factorial of a:"+fact)
</script>
</head>
<body>

</body>
</html>
3. Accept any string from user and count and display number of vowels occurs in it.
<!DOCTYPE html>
<html>
<head>
<title>Document</title>
<script>
var a = prompt("Enter a string:"); // Hello
a = a.toLowerCase();
var counter = 0;
for (var i = 0; i < a.length; i++) {
if (
a[i] == "a" ||
a[i] == "i" ||
a[i] == "o" ||
a[i] == "u" ||
a[i] == "e"
) {
counter++; //2
}
}
document.write("Number of vowels :" + counter);
</script>
</head>
<body></body>
</html>
4. Program to print 4 different Greeting messages using switch case
<!DOCTYPE html>
<html lang="en">
<head>
<title>Document</title>
<script>
var a = 3;
switch (a) {
case 1:
document.write("Hello!");
break;
case 2:
document.write("How are you?");
break;
case 3:
document.write("Good Morning");
break;
case 4:
document.write("Good Nunght");
break;
}
</script>
</head>
<body></body>
</html>
5.Program to check whether the entered number is Odd or Even.

<!DOCTYPE html>
<html>
<head>
<title>Document</title>
<script>
var a = prompt("Enter a number");
a = parseInt(a);
if (a % 2 == 0) {
document.write("Entered number is even");
} else {
document.write("Entered number is odd");
}
</script>
</head>
<body></body>
</html>
6.Program to print numbers from 1-10 using do while loop.

<!DOCTYPE html>
<html>
<head>
<title>Document</title>
<script>
var a = 1;
do {
document.write(a+"<br>");
a++;
} while (a <= 10)
</script>
</head>
<body></body>
</html>
7. Program to check whether the number is prime number of not.
<!DOCTYPE html>
<html>
<head>
<title>Document</title>
<script>
var num = 11;
var isPrime = true;
for (var i = 2; i < num / 2; i++) {
if (num % i == 0) {
isPrime = false;
}
}
if (isPrime == true) {
document.write("Number is prime");
} else {
document.write("Number is not a prime");
}
</script>
</head>
<body></body>
</html>
7.Program to make use of some properties of Window object

<!DOCTYPE html>
<html>
<head>
<title>Document</title>
<script>
window.open();
window.print();
window.close();
</script>
</head>
<body></body>
</html>

8. Program to display alert, prompt and confirm methods of Window Object.


<!DOCTYPE html>
<html>
<head>
<title>Document</title>
<script>
window.alert("This is alert");
var a = window.prompt("Enter a Value");
var b = window.confirm("Press a button!");
</script>
</head>
<body></body>
</html>
9. Program to change background colour of the page in every 4 seconds, there should be
altleast 4 distinct colours except default colour.
<!DOCTYPE html>
<html>
<head>
<title>Document</title>
<script>
var counter = 0;
function next1() {
document.bgColor = "red";
window.setTimeout(next2, 3000);
}
function next2() {
document.bgColor = "green";
window.setTimeout(next3, 3000);
}
function next3() {
document.bgColor = "yellow";
window.setTimeout(next4, 3000);
}
function next4() {
document.bgColor = "blue";
}
window.setTimeout(next1, 3000);
</script>
</head>
<body></body>
</html>
10. Program to make use of open, close and print methods of Window object.

<!DOCTYPE html>
<html>
<head>
<title>Document</title>
<script>
window.open();
window.print();
window.close();
</script>
</head>
<body></body>
</html>

You might also like