You are on page 1of 14

Practical Questions In HTML

1. What is Hyperlink? How it is created in HTML?

Ans: Hyperlink :

A hyperlink can be thought of as an interface that links a source to a


target. Clicking the hyperlink at the source will navigate to the target.
Hyperlinks can assume any of the following appearances:

 Text
 Images
 URLs
 Controls (for example, a button)

Anchor text is a type of hyperlink represented by plain text.

How it is created in HTML :

With HTML, easily add hyperlinks to any HTML page. Link team page, about
page, or even a test by creating it a hyperlink. You can also create a hyperlink for
an external website. To make a hyperlink in an HTML page, use the <a> and
</a> tags, which are the tags used to define the links.
The <a> tag indicates where the hyperlink starts and the </a> tag indicates
where it ends. Whatever text gets added inside these tags, will work as a
hyperlink. Add the URL for the link in the <a href=” ”>. Just keep in mind that you
should use the <a>…</a> tags inside <body>…</body> tags.
2. Define Multimedia? How various types of list can be created in HTML?

Ans : Multimedia :

Multimedia is almost anything you can hear or see (e.g. sound, music, images,
records, videos, films, animations, etc.). It comes in different formats. Web pages
can contain multimedia elements of different formats and types.

Various types of list created in HTML :

The List can be used to store the information in short, either in bulleted form or
numbered format, that visually help to look at a glance. In other words, it is used
to group together related items or lists, & used to structure and show important
information where each list item is displayed on the new line. 
HTML lists allow the content to follow a proper semantic structure. All the tags
in the list require opening and closing tags. There are 3 types of lists in HTML,
namely:
 Unordered List
 Ordered List
 Description List
We will explore all the List types in HTML, along with their implementation
through the examples.
Unordered List: An Unordered list is used to create a list of related items, in
bulleted or unordered format. It starts with the <ul> tag, followed by the <li> tag
to show list items inside <ul> tag. 
Syntax:
<ul>
<li>Item1</li>
...
</ul>
Ordered Lists: The Ordered lists have an order which is either numerical or
alphabetical. The <ol> tag is used to create ordered lists in HTML and just like
unordered list, we use <li> tag to define or show lists inside <ol> tag.
Syntax:
<ol>
<li>Item1</li>
<li>Item2</li>
<li>Item3</li>
</ol>
Description List: A description list is a type of list where each item has a
description. It is also known as a definition list. The <dl> tag is used to create
description list, the <dt> tag defines the item, and the <dd> tag describes each
item in list.
Syntax: 
<dl> Contents... </dl>

3. Describe DHTML? Explain various text formatting facility available in HTML?

Ans : DHTML :

DHTML stands for Dynamic Hypertext Markup language i.e., Dynamic HTML.


Dynamic HTML is not a markup or programming language but it is a term that
combines the features of various web development technologies for creating the
web pages dynamic and interactive.

The DHTML application was introduced by Microsoft with the release of the
4th version of IE (Internet Explorer) in 1997.

Components of Dynamic HTML

DHTML consists of the following four components or languages:

o HTML 4.0

o CSS

o JavaScript

o DOM.

Various Text Formatting available in HTML :

Making text Bold or Strong: We can make the text bold using the <b> tag.


The tag uses both opening and closing tags. The text that needs to be made
bold must be within <b> and </b> tag. We can also use the <strong> tag to
make the text strong, with added semantic importance. It also opens with
<strong> and ends with </strong> tag.
Making text Italic or emphasize: The <i> tag is used to italicise the text. It
opens with <i> and ends with </i> tag. The <em> tag is used to emphasize the
text, with added semantic importance. It opens with <em> and ends with </em>
tag.
Highlighting a text: It is also possible to highlight a text in HTML using
the <mark> tag. It has a opening tag <mark> and a closing tag </mark>.
Making a text Subscript or Superscript : The <sup> element is used to
superscript a text and the <sub> element is used to subscript a text. They both
have an opening and a closing tag.
Making text smaller: The <small> element is used to make the text smaller.
The text that needs to be displayed smaller should be written inside <small>
and </small> tag.
Striking through the text: The <del> element is used to strike through the text
marking the part as deleted. It also has an opening and a closing tag.
Adding a text: The <ins> element is used to underline a text marking the part
as inserted or added. It also has an opening and a closing tag.

4. Write a note on DOM?

Ans : The Document Object Model (DOM) is a programming


interface for HTML and XML(Extensible markup language) documents. It
defines the logical structure of documents and the way a document is
accessed and manipulated.
Note: It is called a Logical structure because DOM doesn’t specify any
relationship between objects. 
DOM is a way to represent the webpage in a structured hierarchical way so that
it will become easier for programmers and users to glide through the document.
With DOM, we can easily access and manipulate tags, IDs, classes, Attributes,
or Elements using commands or methods provided by the Document object.
Why DOM is required?
HTML is used to structure the web pages and Javascript is used to
add behavior to our web pages. When an HTML file is loaded into the browser,
the javascript cannot understand the HTML document directly. So, a
corresponding document is created(DOM). DOM is basically the
representation of the same HTML document but in a different format with
the use of objects. Javascript interprets DOM easily i.e javascript can not
understand the tags(<h1>H</h1>) in HTML document but can understand
object h1 in DOM. Now, Javascript can access each of the objects (h1, p, etc)
by using different functions.
Structure of DOM: DOM can be thought of as a Tree or Forest(more than one
tree). The term structure model is sometimes used to describe the tree-like
representation of a document. One important property of DOM structure models
is structural isomorphism: if any two DOM implementations are used to
create a representation of the same document, they will create the same
structure model, with precisely the same objects and relationships.
Why called an Object Model?
Documents are modeled using objects, and the model includes not only the
structure of a document but also the behavior of a document and the objects of
which it is composed of like tag elements with attributes in HTML.
Properties of DOM:

 Window Object: Window Object is always at top of the hierarchy.


 Document object: When an HTML document is loaded into a window, it
becomes a document object.
 Form Object: It is represented by form tags.
 Link Object: It is represented by link tags.
 Anchor Object : It is represented by a href tags.
 Form Control Elements: Form can have many control elements such as text
fields, buttons, radio buttons, and checkboxes, etc.

5. What is Cookies? Explain the working of firewall?

Ans : Cookies :

A cookie is an amount of information that persists between a server-side and a


client-side. A web browser stores this information at the time of browsing.

A cookie contains the information as a string generally in the form of a name-


value pair separated by semi-colons. It maintains the state of a user and
remembers the user's information among all the web pages.

Working of Firewall :

How Does a Firewall Work?

As mentioned previously, firewalls filter the network traffic within a private


network. It analyses which traffic should be allowed or restricted based on a set
of rules. Think of the firewall like a gatekeeper at your computer’s entry point
which only allows trusted sources, or IP addresses, to enter your network. 

A firewall welcomes only those incoming traffic that has been configured to
accept. It distinguishes between good and malicious traffic and either allows or
blocks specific data packets on pre-established security rules. 

These rules are based on several aspects indicated by the packet data, like their
source, destination, content, and so on. They block traffic coming from
suspicious sources to prevent cyberattacks. 
Fig: Firewall allowing Good Traffic

  

Fig: Firewall blocking Bad Traffic

6. Describe Client-Server Computing? Differentiate among LAN, MAN and WAN?

Ans : Client Server Computing :

In client server computing, the clients requests a resource and the server
provides that resource. A server may serve multiple clients at the same time
while a client is in contact with only one server. Both the client and server usually
communicate via a computer network but sometimes they may reside in the
same system.
An illustration of the client server system is given as follows −
Differences between LAN, MAN, and WAN
Basis LAN MAN WAN

MAN stands for


LAN stands for local metropolitan area WAN stands for wide
Full-Form area network. network. area network.

Operates in small
areas such as the Operates in larger areas
Geographic same building or Operates in large such as country or
Span campus.  areas such as a city. continent.

MAN’s ownership While WAN also might


LAN’s ownership is can be private or not be owned by one
Ownership private. public. organization.

Transmission The transmission While the Whereas the


Basis LAN MAN WAN

speed of a LAN is transmission speed transmission speed of a


Speed high. of a MAN is average. WAN is low.

The propagation There is a moderate Whereas, there is a long


Propagation delay is short in a propagation delay in propagation delay in a
delay LAN. a MAN. WAN.

Whereas there is more


There is less While there is more congestion than MAN in
Congestion congestion in LAN. congestion in MAN. WAN.

Whereas WAN’s design


LAN’s design and While MAN’s design and maintenance are
Design & maintenance are and maintenance are also difficult than LAN as
Maintenance easy. difficult than LAN. well MAN.

Fault There is more fault While there is less In WAN, there is also
tolerance tolerance in LAN. fault tolerance. less fault tolerance.

7. Define Distributed Computing? Write any 5 HTML tags with example?

Ans : Distributed Computing :

Distributed computing is a model in which components of a software system are


shared among multiple computers. Even though the components are spread out
across multiple computers, they are run as one system. This is done in order to
improve efficiency and performance. 
<col> It defines a column within a table which represent common
properties of columns and used with the <colgroup>
element.

<font> It defines the font, size, color, and face for the content. (Not
supported in HTML5)

<img> It is used to insert an image within an HTML document.

<link> It represents a relationship between current document and


an external resource.

<option It is used to define options or items in a drop-down list.


>

Example

<!DOCTYPE html>
<html lang="en">

<head>
<meta charset="UTF-8">
<title>HTML - doctype tag</title>
</head>

<body>
<p>Doctype is used to declare type of markup language used.</p>
</body>

</html>
8. What is Java Script? Explain various data types of Java Script?

Ans Java Script :

JavaScript is a dynamic computer programming language. It is lightweight and


most commonly used as a part of web pages, whose implementations allow
client-side script to interact with the user and make dynamic pages. It is an
interpreted programming language with object-oriented capabilities.
JavaScript was first known as LiveScript, but Netscape changed its name to
JavaScript, possibly because of the excitement being generated by Java.
JavaScript made its first appearance in Netscape 2.0 in 1995 with the
name LiveScript. The general-purpose core 

The set of types in the JavaScript language consists of primitive


values and objects.

 Primitive values (immutable datum represented directly at the lowest level


of the language)
o Boolean type
o Null type
o Undefined type
o Number type
o BigInt type
o String type
o Symbol type
 Objects (collections of properties)

Primitive values

All types except objects define immutable values (that is, values which can't be changed).
For example (and unlike in C), Strings are immutable. We refer to values of these types
as "primitive values".

Boolean type

Boolean represents a logical entity and can have two values: true and false.


See Boolean and Boolean for more details.
Null type

The Null type has exactly one value: null. See null and Null for more details.

Undefined type

A variable that has not been assigned a value has the value undefined.
See undefined and Undefined for more details.

Numeric types

ECMAScript has two built-in numeric types: Number and BigInt — along with the


related value NaN.

Number type

The Number type is a double-precision 64-bit binary format IEEE 754 value. It is capable
of storing floating-point numbers between 2^-1074 and 2^1024, but can only safely store
integers in the range -(2^53 − 1) to 2^53 − 1. Values outside of the range
from Number.MIN_VALUE to Number.MAX_VALUE are automatically converted to
either +Infinity or -Infinity, which behave similarly to mathematical infinity,
but with some slight differences; see Number.POSITIVE_INFINITY for details.

BigInt type

The BigInt type is a numeric primitive in JavaScript that can represent integers with
arbitrary precision. With BigInts, you can safely store and operate on large integers even
beyond the safe integer limit for Numbers.

A BigInt is created by appending n to the end of an integer or by calling the constructor.

String type

JavaScript's String type is used to represent textual data. It is a set of "elements" of 16-bit
unsigned integer values. Each element in the String occupies a position in the String. The
first element is at index 0, the next at index 1, and so on. The length of a String is the
number of elements in it.
Symbol type

A Symbol is a unique and immutable primitive value and may be used as the key of an


Object property (see below). In some programming languages, Symbols are called
"atoms".

For more details see Symbol and the Symbol object wrapper in JavaScript.

Objects

In computer science, an object is a value in memory which is possibly referenced by


an identifier.

9. Explain various operators of java script?

Ans :

1. Arithmetic Operators: They are used to perform simple arithmetic


operations on primitive data types. 
 * : Multiplication
 / : Division
 % : Modulo
 + : Addition
 – : Subtraction
2. Unary Operators: Unary operators need only one operand. They are used to
increment, decrement or negate a value. 
 – : Unary minus
 + : Unary plus 
 ++ : Increment operator
 — : Decrement operator
 ! : Logical not operator

3. Assignment Operator: ‘=’ Assignment operator is used to assign a value to


any variable. It has a right to left associativity, i.e. value given on the right-hand
side of the operator is assigned to the variable on the left, and therefore right-
hand side value must be declared before using it or should be a constant. 
The general format of the assignment operator is:
variable = value;

4. Relational Operators: These operators are used to check for relations like


equality, greater than, less than. They return boolean results after the
comparison and are extensively used in looping statements as well as
conditional if-else statements. The general format is, 
variable relation_operator value

5. Logical Operators: These operators are used to perform “logical AND” and


“logical OR” operations, i.e., the function similar to AND gate and OR gate in
digital electronics. One thing to keep in mind is the second condition is not
evaluated if the first one is false, i.e., it has a short-circuiting effect. Used
extensively to test for several conditions for making a decision. Java also have
“Logical NOT”, it returns true when condition is false and vice-versa
Conditional operators are:
 &&, Logical AND
 ||, Logical OR
 ! , Logical NOT

6. Ternary operator: Ternary operator is a shorthand version of the if-else


statement. It has three operands and hence the name ternary.
The general format is:
condition ? if true : if false

10. Describe any 5 HTML tags with example

Ans :

<col> It defines a column within a table which represent common


properties of columns and used with the <colgroup>
element.

<font> It defines the font, size, color, and face for the content. (Not
supported in HTML5)

<img> It is used to insert an image within an HTML document.

<link> It represents a relationship between current document and


an external resource.

<option It is used to define options or items in a drop-down list.


>

Example

<!DOCTYPE html>
<html lang="en">

<head>
<meta charset="UTF-8">
<title>HTML - doctype tag</title>
</head>

<body>
<p>Doctype is used to declare type of markup language used.</p>
</body>

</html>

You might also like