0% found this document useful (0 votes)
10 views17 pages

Web & Tech

Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
10 views17 pages

Web & Tech

Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 17

Ans :: $

(a) Which attribute of <script> tag used to Example :-- $variableName = value;
include an external java script in an HTML (f) What is event bubbling in Java Script ?
document ? Ans :: Event bubbling in JavaScript refers to
Ans: src attribute the process where an event starts from the
target element and propagates upwards to the
(b) What do you mean by paired tag ? outer elements in the DOM hierarchy.
Ans:
A paired tag in HTML (HyperText Markup (g) Which tag is used to set table heading ?
Language) consists of an opening tag and a
closing tag. They work together to encapsulate Ans :: <th>.<tr>,<td>
content within them. (h) What is the use of <hr> tag in HTML ?
Ans : The <hr> tag in HTML is used to insert a
(c) Write the use of strpos ( ) function in PHP. horizontal rule, typically to create a thematic
break or to separate content sections.
Ans : The strpos() function in PHP is used to find
the position of the first occurrence of a substring (i) What What is the use of comment in HTML ?
within a string. It returns the numeric position of Ans :: The use of comments in HTML is to add
the first occurrence of the substring, or false if
the substring is not found. non-displayed notes or explanations within the

(d) What do you mean by “Server side code, which are helpful for developers to
scripting” ? understand or organize the code. Comments are
Ans: Server-side scripting refers to enclosed within <!-- and -->.
programming that is executed on the server,
helping generate dynamic web content before it
is sent to the client's browser. (j)How to include External CSS in the
webpage ?

(e) How to define a variable in PHP ?


Ans :: To include external CSS in a webpage, Ans :: the continue statement in JavaScript is
you use the <link> tag within the <head> section used within loops to skip the current iteration
of your HTML document. The rel attribute
specifies the relationship between the current and continue with the next iteration. It allows you
document and the linked resource, while the href to bypass certain iterations based on specific
attribute provides the URL of the external CSS
conditions without terminating the entire loop.
file.
Example :- for (let i = 0; i < 5; i++) {
Example :- <head>
if (i === 2) {
<link rel="stylesheet" type="text/css"
href="styles.css"> </head> continue; // Skip the iteration where i is 2
(k)Specify any four formatting tags used in }
HTML.
console.log(i); // This will print 0, 1, 3, 4
Ans :: <b>,<i>,<u>,<em>
}
(l)Write different types of selectors used in
CSS. (n)What is $ and $$ variables in PHP ?
Ans :(1) Element Selector: Selects all elements Ans :: $variable: This is a standard variable. The
of a specified type. dollar sign ($) is used to declare a variable.
(2) Class Selector: Selects elements with a Example:- $name = "John";
specific class attribute.
$$variable: This is known as a variable variable.
(3) ID Selector: Selects an element with a It allows you to use the value of one variable to
specific ID attribute. name another variable.
(4) Attribute Selector: Selects elements based Example :- $variable = "name"; $$variable =
on an attribute and its value. "John"; // This is equivalent to $name = "John";
(o)Write any three key differences between GET
and POST method.

(m)What is the use of continue statement in Ans :: Data Visibility:


Java Script ?
 GET: Data sent via the GET method is typically defining its behavior, appearance, and
visible in the URL. It appends the data to other properties.
the URL as query parameters. Example :- <a href="https://www.example.com"
target="_blank">Visit Example</a>
 POST: Data sent via the POST method is
(r)Write the use of <footer> tag in html.
included in the request body, making it not
visible in the URL. Ans : The <footer> tag in HTML is used to define
the footer section of a document or a section. It
-- Data Length: typically contains information like the author,
 GET: There is a limit on the amount of data copyright details, contact information, or
navigation links.
that can be sent because URLs have
length restrictions. Example :- <footer>

 POST: There is no significant limit on the <p>&copy; 2025 Your Company. All rights
reserved.</p>
amount of data that can be sent, making it
<nav>
suitable for large data transfers.
<a href="/about">About Us</a>
<a href="/contact">Contact</a>
(p)What is the use of <marquee> tag in HTML ?
<a href="/privacy">Privacy Policy</a>
Ans :: The <marquee> tag in HTML is used to
create a scrolling text or image animation on a </nav>
webpage, moving content horizontally or
</footer>
vertically.
(s)Explain cell spacing and cell padding in HTML
Example :- <marquee>Scrolling Text
Example</marquee> with the help of a suitable example.

(q)What is the use of attributes in a tag ? Ans : - Cell Spacing: This refers to the space
between individual table cells. It sets the
Ans :- Attributes in an HTML tag provide
additional information about the element, distance between the borders of adjacent cells.
-Cell Padding: This refers to the space between Boolean: Represents two possible states: true or
the content of a cell and its border. It sets the false.
distance between the cell content and the cell
border.
Array: An ordered collection of values, e.g.,
(t)How can you create an object in JavaScript ? array(1, 2, 3).
Ans : You can create an object in JavaScript
using object literal notation or by using the new
Object() Object: An instance of a class.

Ex:- let person = new Object();


person.name = "John"; NULL: A special data type that represents a

person.age = 30; variable with no value.

person.city = "New York";


(u)Explain different types of data types used in Resource: A special variable, holding a

PHP. reference to an external resource (e.g., a


database connection).
Ans :- String: A sequence of characters, e.g.,
"Hello, World!". (v)What is contextual selector in CSS ?
Ans : A contextual selector (also known as
a descendant selector) in CSS targets an
Integer: Whole numbers, e.g., 42. element that is nested within another
element. It allows you to apply styles to
elements based on their hierarchical
Float (Double): Numbers with a decimal point, relationships in the DOM.
e.g., 3.14. (w)Explain how JavaScript is embedded in
HTML page.
Ans :: JavaScript can be embedded in an HTML 2. Reusability: You can apply the same
page using the <script> tag. You can place it styles to multiple HTML elements,
within the <head> or <body> sections, or link to promoting consistency and reducing code
an external JavaScript file. duplication.
Ex :- <!DOCTYPE html> Disadvantages:
<html> 1. Browser Compatibility: Different browsers
<head> may render CSS styles differently, leading
to inconsistencies.
<script> function greet() { alert("Hello, World!"); }
</script> 2. Complexity: As the website grows,
managing CSS can become complex,
</head>
especially with nested and conflicting
<body>
styles.
<button onclick="greet()">Click Me</button>
</body>
(y)How to create a cookie using JavaScript ?
</html>
Ans : You can create a cookie using the
document.cookie property in JavaScript.
(x)Write any two advantages and disadvantages
of CSS. Ex :- document.cookie = "username=JohnDoe;
expires=Fri, 31 Dec 2025 23:59:59 GMT;
Ans : - Advantages: path=/";
1. Separation of Content and Style: CSS
(z)Write the use of alert ( ) and confirm ( ) dialog
allows you to separate the content (HTML)
box.
from its presentation (CSS), making
Ans : alert(): This function displays a simple
maintenance easier.
dialog box with a specified message and an OK
button. It's typically used to inform users or show <font size="4">This is size 4 text.</font>
alerts. 3. color: Specifies the color of the text.
Ex :- alert("This is an alert box!"); <font color="red">This text is red.</font>
confirm(): This function displays a dialog box
with a specified message, along with OK and (b)What is Event in JavaScript ? Write any two
Cancel buttons. It returns true if OK is clicked, mouse events.
and false if Cancel is clicked. It's used to get
Ans : An event in JavaScript represents any
user confirmation before proceeding with an
interaction or occurrence that can be detected
action.
and responded to. Events are typically
Ex:- let userResponse = confirm("Do you want associated with user actions or browser
to proceed?"); activities.
if (userResponse) { Two mouse events are:
// User clicked OK --click: Occurs when the user clicks on an
} else { // User clicked Cancel } element.
(a)What is the use of font tag in HTML ? Write javascript
any two attributes of font tag. element.addEventListener("click", function() {
Ans : The <font> tag was historically used to console.log("Element was clicked!");
define the font size, color, and face for text.
});
However, it's important to note that the <font>
-- mouseover: Occurs when the user moves the
tag is now obsolete in HTML5 and should be
mouse pointer over an element.
replaced with CSS for better practice and
javascript
compatibility.
element.addEventListener("mouseover",
1.Two attributes of the <font> tag are:
function() {
1. size: Specifies the size of the text.
console.log("Mouse is over the element!"); });
(c)CSS stands for ____. <html>: The root element that contains all
other HTML elements.
Ans : Cascading Style Sheets.
1..<H> tag can be set in __6__ different sizes.
<head>: Contains meta-information about the
2..In java script, DOM stands for __Document
document, such as the title and links to
object model__.
stylesheets.
3..For line break _<br>___ tag is used in HTML.
4..Multiple Frames can be arranged using __
<title>: Sets the title of the document, which
<frameset>__ tag.
appears in the browser's title bar or tab.
5..Hyperlink could be created using ___<a>_
tag.
<body>: Contains the content of the document
6..PHP stands for -- Hypertext Preprocessor.
that is displayed to users.
7..In PHP, array could be created using _
(10)How can you define table in HTML ?
array()___ function.
(8)What is web browser ? Ans : A table in HTML is defined using the
<table> tag. Inside the table, rows are defined
Ans : A web browser is a software application using the <tr> tag, and each row contains
that allows users to access, retrieve, and view cells defined by <td> (table data) or <th>
information on the World Wide Web. It (table header) tags.
interprets and displays web pages written in
HTML and other web technologies. Examples Example:
of web browsers include Google Chrome, <table> <tr> <th>Header 1</th> <th>Header
Mozilla Firefox, Microsoft Edge, and Safari. 2</th> </tr> <tr> <td>Data 1</td> <td>Data
(9)State the basic structure of any HTML 2</td> </tr></table>
document. (11)What HTML tag ? State the types of tags
Ans : <!DOCTYPE html>: Declares the used in any HTML documents.
document type and version of HTML. Ans : An HTML tag is a code element used to
define the structure and content of an HTML
document. HTML tags are enclosed in angle
brackets (< and >), and most tags come in
pairs, with an opening tag (<tag>) and a (<img>) and forms are often treated as objects
closing tag (</tag>). and can be styled using CSS properties.
Types of tags used in HTML documents:
1. Structural Tags: Define the overall
structure of the document (e.g., <html>,
<head>, <body>). (13)State the syntax of CSS class.

2. Formatting Tags: Apply styles to text (e.g., Ans : To define a CSS class, you use a period
<b>, <i>, <u>, <em>). (.) followed by the class name and a set of
curly braces containing the style rules.
3. Content Tags: Define the content within
the document (e.g., <p>, <h1> to <h6>, Ex: .classname {
<a>, <img>, <table>). property: value;
4. Meta Tags: Provide meta-information property: value;
about the document (e.g., <title>, <meta>). }
(14)Write the syntax of eval(), parselnt() and
(12)What is block element and object in CSS ? parseFloat().
Ans : eval(): Evaluates a string as JavaScript
Ans :;  Block Element: A block element in code and executes it.
CSS is an HTML element that starts on a new
parseInt(): Parses a string and returns an
line and takes up the full width available,
integer.
stretching out to the left and right as far as it
can. Examples include <div>, <p>, <h1> to parseFloat(): Parses a string and returns a
<h6>, and <section>. Block elements can floating-point number.
contain other block elements and inline (15)What is the significance of pseudo class in
elements. CSS ?
Ans : Pseudo-classes in CSS are used to
 Object: In CSS, an object usually refers to define the special states of an element. They
an element that is considered as an entity for allow you to style elements based on their
styling purposes. For example, images state or position in the document tree, without
needing to add extra classes or IDs.
Examples include :hover, :active, :nth-child(), The essence of server-side scripting lies
and :focus. in its ability to:
Ex : a:hover { 1. Generate Dynamic Content: Create and
color: red; /* Changes link color to red when display web pages based on user input,
hovered over */
preferences, and interactions.
}
2. Manage Databases: Interact with
(16)What is event ? State the name of any two
databases to store, retrieve, and
event handler commonly used java script.
manipulate data, enabling functionalities
Ans : Event: An event in JavaScript
represents an action or occurrence detected like user authentication, content
by the browser, such as user interactions management, and data analytics.
(clicks, key presses) or browser actions (page 3. Enhance Security: Process sensitive data
load, resize). Events allow you to execute
securely on the server, reducing exposure
JavaScript code in response to user activities.
to client-side vulnerabilities.
Two common event handlers:
(18)Compare cell spacing and cell padding.
1. onclick: Triggered when an element is
clicked. Ans : Cell Spacing: This is the space
between individual table cells. It controls the
2.onload: Triggered when an element
distance between the borders of adjacent
(typically a page or an image) has finished
cells.
loading.
Ex: <table border="1" cellspacing="10">
(17)What is the essence of server side
<!-- Cell spacing is set to 10 pixels -->
scripting ?
</table>
Ans : Server-side scripting involves
Cell Padding: This is the space between the
running scripts on a web server to
content of a cell and its border. It controls the
generate dynamic web content, manage distance between the cell content and the cell
databases, and handle user interactions. border.
Ex : <table border="1" cellpadding="10">
<!-- Cell padding is set to 10 pixels --> Ans : HTML is a collection of items that are
</table> displayed in a specific order or as a group.
There are three types of lists commonly used
(19)What is Frame ? Distinguish between HTML
in web pages:
Frame and Web page.
1.Ordered List (<ol>): Displays items in a
Ans : Frame: In HTML, a frame is a container
numbered sequence.
that can load and display multiple HTML
documents within a single web page. Frames 2. Unordered List (<ul>): Displays items with
are created using the <frameset> tag, and bullet points.
each frame is defined using the <frame> tag. 3. Definition List (<dl>): Displays items as
- HTML Frame: terms and descriptions.Compare browser
object with DOM.
 Created using the <frameset> and <frame>
tags. (21)What is DHTML ? State the essence of
DHTML in web page designing.
 Allows for multiple independent documents
to be displayed within a single window. Ans : Dynamic HTML (DHTML) is an umbrella
term for technologies that enable interactive
 Can lead to complex navigation and
and animated websites by combining HTML,
bookmarking issues.
CSS, JavaScript, and the DOM.
- Web Page:
Essence of DHTML in web page designing:
 A single HTML document displayed in a
 Enhances User Experience: Provides
browser.
interactivity and animations, making web
 Typically created using the <html>, pages more engaging.
<head>, and <body> tags.
 Real-Time Updates: Allows content to
 Easier to manage, navigate, and bookmark change dynamically based on user
compared to frames. interactions.
 Flexibility: Offers greater control over the
(20)What is list ? State the three types of list presentation and behavior of web elements
commonly used in web page.
(22)What is the essence of PHP in web page Ans : The ** operator in PHP is used for
designing. exponentiation, raising a number to the power
Ans : PHP (Hypertext Preprocessor) is a of another number.
server-side scripting language widely used for Example :-
web development. It is embedded within $result = 2 ** 3; // 2 raised to the power of 3
HTML to create dynamic web pages and echo $result; // Output: 8
applications.
(25)Compare ?: operator with ?? operator of
Essence of PHP in web page designing: PHP.
 Server-Side Processing: Handles form Ans : ?: (Ternary Operator): The ternary
submissions, database interactions, and operator is a shorthand for the if-else
other server-side tasks. statement. It evaluates a condition and returns
 Dynamic Content: Generates customized one of two values based on whether the
web content based on user input, session condition is true or false.
data, and database queries. ?? (Null Coalescing Operator): The null
 Integration: Seamlessly integrates with coalescing operator checks if a variable is set
HTML, CSS, JavaScript, and databases and is not null. If the variable is not set or is
like MySQL to build full-featured web null, it returns a default value.
applications.  The ternary operator ?: evaluates a
condition and returns one of two values based
(23)Compare the < > operator with ! = = on the result.
operator in PHP.  The null coalescing operator ?? checks if a
Ans :< > Operator: Used as an alternative to ! variable is set and not null, returning a default
= to check if two values are not equal. value if it is not.

!= Operator: Checks if two values are not


equal. (26)How can you define multi-dimensional array
(24)What ** operator does in PHP ? Write an in PHP ?
example. Give an example.
Ans : A multi-dimensional array in PHP is (27).HTML document can have three types of list
an array containing one or more arrays. It tags and these are and _<_dl>__, __<ol>__ and
can be defined as follows: __<ul>__.
$multiDimensionalArray = array( a. HTML document accepts ____ and ____
array( picture formats.
"name" => "John",
Ans : JPEG(JPG) AND PNG
"age" => 25,
c.. In HTML document, table rows can be of
"city" => "New York"
____ and ____ types.
),
Ans : header rows<th>,data row<td>
array(
"name" => "Jane", d. The hexadecimal color code for white can
"age" => 30, be expressed as # ____.

"city" => "Los Angeles" Ans : #FFFFFF.


), e. The <TH> tag is used for ____.
array(
Ans :- The <th> tag is used for table headers.
"name" => "Doe", It defines a header cell in an HTML table and
"age" => 22, is typically displayed in bold and centered.
"city" => "Chicago"
)
f. The <FRAMESET> tag is used for ____.
);
Ans : - The <frameset> tag is used for
// Accessing elements defining a frameset in an HTML document. It
specifies a collection of frames, which can be
echo $multiDimensionalArray[0]
used to divide the browser window into
["name"]; // Output: John
multiple sections where each section can load
echo $multiDimensionalArray[1]["city"]; //
a separate HTML document.
Output: Los Angeles
g. In the <IMG> tag the ALT attribute
indicates ____.
Ans : In the <img> tag, the alt attribute CELLPADDING: Specifies the space between
indicates alternative text. This text is the content of a cell and its border.
displayed if the image cannot be loaded and is
(30)What is the essence of <SPAN> tag in
also used by screen readers to describe the
CSS ?
image for visually impaired users.
Ans : The <span> tag is used to apply styles
h. The <HR> is used for :-
or scripts to a specific section of text within a
block-level element. It is an inline container,
meaning it does not break the flow of the
content.

Ans : The <hr> tag is used for inserting a (31)What is the need of <MAP> tag in the HTML
horizontal rule (or horizontal line) in an document ?
HTML documenta. Ans : The <map> tag is used to define an
image map, which is a clickable image with
defined areas that act as hyperlinks. Each
area within the <map> tag can be associated
with different URLs or actions.
(28)what is CSS?
Example: <img src="image.jpg"
Ans : CSS (Cascading Style Sheets) is a usemap="#imagemap">
stylesheet language used to define the
presentation and layout of web pages. It allows <map name="imagemap">
you to control the appearance of elements, <area shape="rect" coords="34,44,270,350"
including colors, fonts, spacing, and positioning, href="page1.html">
separately from the HTML content.
<area shape="circle" coords="130,136,60"
(29)What is the difference between href="page2.html">
CELLSPACING and CELLPADDING attriutes of
</map>
<TABLE> ?
Ans : CELLSPACING: Specifies the space
between the borders of adjacent table cells.
(32)<DIV> .... </DIV> tag used to divide a web Ans : alert(): Displays an alert box with a
page into seg- ments which can be positioned specified message.
anywhere on the page. Whether TRUE or
parseInt(): Parses a string and returns an
FALSE. Justify your answer.
integer.
Ans : TRUE. The <div> tag is a block-level
Math.random(): Returns a random number
element used to create sections or divisions
between 0 (inclusive) and 1 (exclusive).
within a web page. These segments can be
styled and positioned using CSS to appear (36)State, how we can receive user input with
anywhere on the page. an dialog box in Java Script.

(33)State the differences between == and === in Ans : You can use the prompt() function to
the Java Script. display a dialog box that prompts the user for
input.
Ans : ==(Equality Operator): Compares two
values for equality, performing type Example : var userInput = prompt("Please
conversion if necessary. enter your name:");

===(Strict Equality Operator): Compares console.log("User's name is " + userInput);


two values for equality without type (37)State the difference between ‘Check box’
conversion. Both the value and type must be and ‘radio button’.
the same.
Ans : Checkboxes allow multiple selections,
(34)New operator in Java Script can be used for while radio buttons allow only one selection
defining an array. TRUE or FALSE. Justify your within a group.
answer.
Ans : The new operator can be used to create
(38)What is event handling ? State any four
an instance of an array.
event handlers of Java Script.
Ex : var arr = new Array(1, 2, 3);
Ans : Event handling in JavaScript refers to
console.log(arr); // Output: [1, 2, 3]
the process of detecting and responding to
(35)State any three built-in functions of user actions or browser events. It allows
JavaScript.
developers to execute specific code when an };
event occurs, such as clicking a button, onkeyup: Triggered when a key is released on
submitting a form, or hovering over an element. the keyboard.
 onclick: Triggered when an element is javascript
clicked.
document.getElementById("myInput").onkeyup
javascript = function() {
document.getElementById("myButton").onclick console.log("Key released!");
= function() {
}
alert("Button was clicked!");
(39)State the method through which we can
}; place text in a browser
 onmouseover: Triggered when the mouse
pointer is moved over an element. Ans :

javascript
To place text in a browser, you can use HTML
document.getElementById("myElement").onmo elements such as <p>, <h1> to <h6>, and
useover = function() { <span>

this.style.color = "red";
paragraph (<p>): Used for regular paragraphs
}; of text.
 onload: Triggered when an element
Headings (<h1> to <h6>): Used for headings,
(typically the window or an image) has finished
with <h1> being the largest and <h6> the
loading. smallest.
javascript
window.onload = function() { Span (<span>): Used for inline text to apply
styles or scripts.
alert("Page has loaded!");
(40)State the three types of dialog box used in (41)What is the essence of Java Script DOM ?
Java Script.
Ans : The Document Object Model (DOM) is a
Ans : Three types of dialog box used in programming interface for web documents. It
JavaScript: represents the structure of a document as a
tree of objects, allowing scripts to access,
1. Alert Box (alert): Displays a message to
manipulate, and update the content, structure,
the user with an OK button.
and style of a web page. The essence of the
javascript DOM lies in its ability to:
alert("This is an alert box!");  Dynamically update content and structure.
2. Confirm Box (confirm): Displays a  Respond to user interactions.
message with OK and Cancel buttons,
 Manipulate HTML and CSS elements
allowing the user to confirm or cancel an
programmatically.
action.
javascript
(42)In the case of DHTML, what is the
if (confirm("Do you want to proceed?")) {
significance of <LAYER>tag.
// User clicked OK
Ans : The <layer> tag was used in early web
} else { development for positioning and layering
// User clicked Cancel content on a web page, primarily in Netscape
Navigator. It allowed elements to be positioned,
}
shown, and hidden dynamically. However, it is
3. Prompt Box (prompt): Displays a message now obsolete and has been replaced by more
asking the user for input, with an input field, modern techniques like CSS positioning and
OK, and Cancel buttons. JavaScript.
var userInput = prompt("Please enter your (43)State the syntax of for each loop used in
name:"); PHP.
Ans : The foreach loop in PHP is used to echo $displayName; // Output: Guest
iterate over arrays. It simplifies looping
through array elements.
(45)State any four mathematical functions, that
Example:
are used in PHP.
php
Ans :  abs(): Returns the absolute value of a
$array = array("apple", "banana", "cherry"); number.
foreach ($array as $value) { Ex : - echo abs(-10); // Output: 10
echo $value . "<br>";  round(): Rounds a floating-point number to the
nearest integer.
}
Ex :- echo round(4.6); // Output: 5
Alternatively, with key-value pairs:
 sqrt(): Returns the square root of a number.
php
Ex : -echo sqrt(25); // Output: 5
$associativeArray = array("a" => "apple", "b"
=> "banana", "c" => "cherry");  pow(): Raises a number to the power of another
number.
foreach ($associativeArray as $key => $value)
){echo “$key : $value<br>”;} Ex :-echo pow(2, 4); // Output: 16
(44)What is the use of ??operator in PHP ?
Ans : The ?? (null coalescing) operator in PHP is
used to check if a variable is set and not null. It
returns the variable's value if it is set; otherwise, it
returns a default value.
Example:
$name = null;
$defaultName = "Guest";
$displayName = $name ?? $defaultName;

You might also like