Web Development Test
Web Development Test
Name-Meenal
Batch-4(Online-Evening)
Answer---<a>
Answer---background-inline
Answer---alert("Hello!");
Answer---object
Answer---static
Answer---<form>
Answer---Change the content inside the HTML element with ID "demo" to "Hello"
9. Which CSS unit is relative to the font size of the parent element?
Answer---em
Html Code
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Navigation Bar</title>
</head>
<body>
<nav>
<ul>
<li><a href="#home">Home</a></li>
<li><a href="#about">About</a></li>
<li><a href="#contact">Contact</a></li>
</ul>
</nav>
</body>
</html>
CSS Code
nav {
background-color: blue;
text-align: center;
padding: 10px 0;
nav ul {
list-style-type: none;
margin: 0;
padding: 0;
nav ul li {
display: inline;
margin: 0 15px;
nav ul li a {
text-decoration: none;
color: white;
font-size: 18px;
nav ul li a:hover {
color: yellow;
12. Write a JavaScript function named isEven(num) that checks if a number is even. The function should:
• Take a number as input
CODE
function isEven(num) {
if (num % 2 === 0) {
return "Even";
} else {
return "Odd";
console.log(isEven(4));
console.log(isEven(7));
• When the button is clicked, it should change the background color of the webpage to red.
CODE
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
</head>
<body>
<script>
document.getElementById('btn').onclick = function() {
document.body.style.backgroundColor = 'red';
};
</script>
</body>
</html>