CSS Model Answer Practise Test 3 by Rit 2 Mark Questions
CSS Model Answer Practise Test 3 by Rit 2 Mark Questions
Ex
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Image Rollover Example</title>
<script>
// Function to change image when hovered
function changeImage() {
document.getElementById('image').src = 'hover-image.jpg';
}
Q.3) Explain frame works of JavaScript and its application. (Explain any one)
Ans:
JavaScript frameworks are pre-built collections of JavaScript code that provide
a structure for developing web applications. They are designed to make the
development process faster and more efficient by offering ready-made
components, libraries, and tools for common programming tasks such as
manipulating the DOM, handling events, making HTTP requests, and routing.
React.js Framework:
React.js is a popular JavaScript library (often referred to as a framework due to its wide
usage in application development) created and maintained by Facebook. It is primarily
used for building user interfaces, particularly single-page applications (SPAs). React uses
a component-based architecture where the UI is broken down into reusable, self-
contained components.
Application
Mobile Application
Q.4) Give the regular expression for matching digits and non-digits.
Ans:
Ans:
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
</head>
<body>
<ul id="menu">
<li>Home</li>
<li>About
<ul class="submenu">
<li>Team</li>
<li>History</li>
</ul>
</li>
<li>Services
<ul class="submenu">
<li>Web Development</li>
<li>App Development</li>
<li>SEO</li>
</ul>
</li>
<li>Contact</li>
</ul>
<script>
</script>
</body>
</html>
Q.6) What is status bar? Explain with example.
Ans:
A status bar is a graphical control element that provides feedback to the user
about the current status of an application or system. It is typically located at
the bottom of a window or screen and can display information such as:
Ex
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
</head>
<body>
</div>
<script>
function performAction() {
setTimeout(() => {
</script>
</body>
</html>
Q.7) Compare pop-up menu and context menu.
Ans:
Ans:
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Frames Example</title>
</head>
</frameset>
</html>
Q.9) Write the program to validate phone number using regular expression.
Ans:
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
</head>
<body>
<button onclick="validatePhoneNumber()">Validate</button>
<p id="result"></p>
<script>
function validatePhoneNumber() {
if (regex.test(phoneNumber)) {
} else {
document.all['result'].innerHTML = "Invalid phone number. Please
enter a 10-digit number.";
</script>
</body>
</html>
Ans:
Syntax
Ans:
A dynamic menu refers to a menu system that can change or adapt based on
various factors such as user interactions, data from a server, or application
state. Unlike static menus, which remain constant and are hard-coded into
the application, dynamic menus are generated or modified in real-time,
providing a more interactive and responsive user experience.
Q.12) Write a JavaScript code to check whether the string contains the given
pattern or not.
Ans:
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Pattern Check</title>
</head>
<body>
<h1>Pattern Checker</h1>
<p id="result"></p>
<script>
function checkPattern() {
if (regex.test(str)) {
} else {
</script>
</body>
</html>