html java script program (1)
html java script program (1)
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.
(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
(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
(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
<!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>
<!DOCTYPE html>
<html>
<head>
<title>Document</title>
<script>
window.open();
window.print();
window.close();
</script>
</head>
<body></body>
</html>