Unit1 Mma
Unit1 Mma
Multimedia
• Multimedia is a combination of 2 words “Multi” and “Media”.
• The word ‘Multi’ means “Many” and the word ‘Media’ means “Communication”.
• Multimedia is a type of medium that allows information to be easily transferred
from one location to another.
• Multimedia includes Text, Pictures, Audio, Video, etc.,
Animation
• Animation refers to the movement on the screen of the display device created by
displaying a sequence of still images.
Web Browsers
• Documents provided by servers on the Web are requested by browsers, which are
programs running on client machines.
• They are called browsers because they allow the user to browse the resources
available onservers.
• A browser is a client on the Web because it initiates the communication with a
server, which waits for a request from the client before doing anything.
• The server locates the document among its servable documents and sends it to the
browser, which displays it for the user.
• Examples: Internet Explorer, Mozilla Firefox, Netscape Navigator, Google Chrome,
Opera etc.,
Web Design
• Web design is the process of planning, conceptualizing and implementing the
plan fordesigning a website in a way.
HTML
• HTML stands for Hyper Text Markup Language.
• HTML is texting computer language which is simple and easy to learn.
• To design the websites HTML is using.
• HTML is the language of the internet and it is basically consists of tags.
• HTML is a text file consisting of tags and used to design web pages.
• < > (Left and Right) angle brackets are reserved to identify opening and closing
tag in HTML.
• HTML is not a case sensitive language.
• HTML is a “Mother Language” of browser.
• “Tim Berners-Lee” is known as the father of HTML.
Hyper Text
• A text within a text that has link within it.
• If we click on a link which brings us to a new page is a hypertext.
Markup Language
• A computer language that is interpreted by the browser and it defines the
elements within a document using “tags”.
• It’s a human-readable programming language.
❖ HTML 2.0: The second version which was released in 1995 and it was standard
language version for website design. HTML 2.0 was able to support extra
features such as form-based file upload, form elements such as text box, option
button, etc.
❖ HTML 3.0: The third version was published by W3C (World Wide Web
Consortium) in early 1997. Third version was capable of creating tables and
providing support for extra options for form elements. It can also support a web
page with complex mathematical equations.
❖ HTML 4.0: The fourth version was released on December 1999 and it is a very
stable version of HTML language. Fourth version is the current official standard
and it provides added support for stylesheets (CSS) and scripting ability for
various multimedia elements.
❖ HTML 5.0: Fifth version and the newest version of Hyper Text Markup
language. The first draft of this version was announced in January 2008 with a
major update and "W3C Recommendation" status in October 2014.
Here are two major organizations one is W3C (World Wide Web Consortium) and
another one is WHATWG (Web Hypertext Application Technology Working Group)
which are involved in the development of HTML5 version.
1. Paragraph
• Text is normally organized into the paragraphs in the HTML.
• All the text documents are inserted within Paragraph tag.
• Paragraph tag is denoted by <p> .... </p>.
• In displaying the content of a paragraph, the browser puts as many words as will
fit on thelines in the browser window.
• The browser supplies a line break at the end of the line.
Example1 Paragraph:-
<html>
<head>
<title> Paragraph Tag </title>
</head>
<body>
<p>The first version of HTML was 1.0, which was the barebones and it was released
in the year 1991. The second version which was released in 1995 and it was standard
language version for website design. HTML 2.0 was able to support extra features such
as form based file upload, form elements such as text box, option button. </p>
</body></html>
3. Headings
• Heading tags are of six (6) levels in HTML like <h1>…..</h1>, <h2>…..</h2>,
• <h3>…..</h3>, <h4>…..</h4>, <h5>…..</h5> and <h6>…..</h6>.
• Beginning of every section need to be highlighted and it should be represented
in large text i.e in a boldface font, whose default size is depends on the number
in the heading tag.
• <h1> is the highest level heading.
• <h6> is the lowest level heading.
Example for Heading Tag:-
<html>
<head>
<title> Heading Tag </title>
</head><body>
<h1>Heading Tag1 </h1>
<h2> Heading Tag2</h2>
<h3> Heading Tag3</h3>
<h4>Heading Tag4 </h4>
<h5>Heading Tag5 </h5>
<h6>Heading Tag6 </h6>
</body></html>
option button</pre>
</body></html>
Fourth version is the current official standard and it provides added support for
stylesheets (CSS) and scripting ability for various multimedia elements. <hr>
HTML 5.0: Fifth version and the newest version of Hyper Text Markup language. The
first draft of this version was announced in January 2008 with a major update and "W3C
Recommendation" status in October 2014. </p>
</body>
</html>
Lists:
• HTML lists allow web developers to group a set of related items in lists.
• HTML lists are used to specify lists of information.
• Each list item starts with the <li> tag.
Types of List:-
HTML List has 4 Types
1. Ordered List / Numbered List (ol)
2. Unordered List / Bulleted List (ul)
3. Description List / Definition List (dl)
1. Ordered List
• Ordered List starts with the <ol> tag and end with </ol> tag.
• Ordered List is also called as Numbered List.
• The list items in ordered list will be marked with numbers (1,2,3…) by default.
• Instead of numbers we can list with alphabet (A,B,C….. or a,b,c……) or
roman numbers(I, II,III….. or i, ii, iii….).
Table:
• A Table is a matrix of cells, which contain rows and columns.
• A cell in the top row often contain column labels, those in the leftmost columns
oftencontain row labels and rest of the cells contain the data of the table.
• To create table <table> tag is used.
• A Table Row is created by using <tr> tag.
• A Table Header is created by using <th> tag.
• To insert data into a cells <td> tag is used.
• The Table Name can be created using <caption> tag.
Example for Table Tag:-
<html>
<head>
<title> Table </title>
</head>
<body>
<table border="1">
<tr>
<th> Name </th>
<th> Age </th>
</tr>
<td> Ram </td>
<td> 18 </td>
</tr>
<tr>
<td> Seetha </td>
<td> 20 </td>
</tr>
<tr>
<td> Hanuman </td>
<td> 17 </td>
</tr>
</table>
</body></html>
Output for Table Tag
Cell Padding
• Cellpadding is the space between the cell edges and the cell content.
• By default the cellpadding is set to 0.
<html>
<head>
<title> Table </title>
</head>
<body>
<table border="1" cellpadding="5">
<tr>
<th> Name </th>
<th> Age </th>
</tr>
<td> Ram </td>
<td> 18 </td>
</tr>
<tr>
<td> Seetha </td>
<td> 20 </td>
</tr>
<tr>
<td> Hanuman </td>
<td> 17 </td>
</tr>
</table>
</body>
</html>
Output for Table Tag with Cellpadding
Cell Spacing
Rowspan:
• Rowspan attribute is used to make a cell with more than one cell/row.
• Rowspan will divide one cell into multiple rows and the number of rows depend on thevalue
of rowspan attribute.
Example for Table Tag with rowspan:-
<html>
<head>
<title> Table </title>
</head>
<body>
<table border="1">
<tr>
<th> Name </th>
<td> Ram </td>
</tr>
<th rowspan="2">Phone_number</th>
<td> 1234567890 </td>
</tr>
<tr>
<td> 0123456789 </td>
</tr>
</table>
</body>
</html>
Forms:
• To create a form <form> tag is used.
• The most common way for a user to communicate information from a web browser to theserver
is through a form.
• A form is an area that can contain form elements.
• Form elements are the elements that allow the user to enter information.
Ex: Text, drop-down menus, radio buttons, checkboxes, buttons, etc.
1. Input Element
The HTML <input> form Attribute is used to specify interactive input fields for web-based forms. A form
can contain multiple input fields to accept inputs from the users. It is the most powerful element in HTML.
Syntax:
<input form="form_id">
Attribute Value: This attribute contains a single value form_id which contains the value i.e form_id
which specify the one or more than the button element belongs to. The value of this attribute should be
the id of the <form> element.
<form>
<label for="username">Username:</label>
<input type="text" id="username" name="username">
<label for="password">Password:</label>
<input type="password" id="password" name="password">
</body>
</html>
A select box, also called drop down box which provides option to list down various options in the form
of drop down list, from where a user can select one or more options.
3. Radio Buttons
• Radio Button is just like a checkbox, but the difference is that the values of name attribute are
all the same.
• To define a radio button the value of type attribute is “Radio”.
5. <textarea> Tag
• The <textarea> tag defines a multi-line text input control.
• The <textarea> element is often used in a form, to collect user inputs like comments or reviews.
• A text area can hold an unlimited number of characters, and the text renders in a fixed-width font (usually
Courier).
• The size of a text area is specified by the cols and rows attributes (or with CSS).
Example for textarea:
<html>
<body>
<h1>The textarea element</h1>
<form >
<p>Review of W3Schools:</label></p>
<textarea name="w3review" rows="4" cols="50">At [Link] you will learn how to make a
website. They offer free tutorials in all web development technologies.</textarea>
<br>
<input type="submit" value="Submit">
</form>
<p>Click the "Submit" button and the form-data will be sent to a page on the
server called "action_page.php".</p>
</body>
</html>
Frames:
• HTML Frames are used to divide browser window into multiple sections where each section
can load a separate HTML document.
• A collection of frames in the browser window is known as frameset.
• To use frames on a page we need <frameset> tag.
• The <frameset> tag defines how to divide the window into frames.
• The rows attribute defines horizontal frames and cols attribute defines vertical frames in
<frameset> tag.
• NOTE: If the browser not support frames need to add <noframes> tag.
<noframes>
<body>Your browser does not support frames</body>
</noframes>
Creating Frames
• To use frames on a page we use <frameset> tag instead of <body> tag.
• The <frameset> tag defines, how to divide the window into frames.
The rows attribute of <frameset> tag defines horizontal framesand cols
attribute defines vertical frames.
• Each frame is indicated by <frame> tag and it defines which HTMLdocument
shall open into the frame.
<html>
<head>
<title>HTML Frames</title>
</head>
<frameset rows = "10%,80%,10%">
<frame name = "top" src = "/html/top_frame.htm" />
<frame name = "main" src = "/html/main_frame.htm" />
<frame name = "bottom" src = "/html/bottom_frame.htm" />
<noframes>
<body>Your browser does not support frames.</body>
</noframes>
</frameset>
</html>
Advantages of frames
• The main advantage of frames is that it allows the user to view multiple documents
within a single Web page.
• It is possible to load pages from different servers in a single frameset.
Disadvantages of Frames
• Sometimes your page will be displayed differently on different computersdue to different screen
resolution.
• Older browers do not support frames.
• HTML5 is the next major revision of the HTML standard super sending HTML 4.01,
XHTML 1.0 and HTML 1.1.
• HTML5 is a standard for structuring and presenting content on the World Wide Web
(WWW).
• HTML5 is a cooperation between the World Wide Web Consortium (W3C) and the Web
Hypertext Application Technology Working Group (WHATWG).
Feature Description
What is CSS?
• Cascading Style Sheets (CSS) is used to format the layout of a webpage.
• With CSS, you can control the color, font, the size of text, the spacing between elements, how
elements are positioned and laid out, what background images or background colors are to be
used, different displays for different devices and screen sizes, and much more!
• A CSS rule consists of a selector and a declaration block.
CSS Syntax
The declaration block contains one or more declarations separated by semicolons. Each declaration
includes a CSS property name and a value, separated by a colon.
Multiple CSS declarations are separated with semicolons, and declaration blocks are surrounded by curly
braces.
Example
In this example all <p> elements will be center-aligned, with a red text color:
p{
color: red;
text-align: center;
}
Levels/types of Style Sheet or Style Specification Formats:
Inline Style Sheet: by using the style attribute inside HTML elements
Internal Style Sheet: by using a <style> element in the <head> section
External Style Sheet: by using a <link> element to link to an external CSS file
External CSS
What is External CSS ?
External CSS is used to style multiple HTML pages with a single style sheet. External CSS contains a
separate CSS file with a .css extension. The CSS file contains style properties added on selectors (For
example class, id, heading, … etc.).
CSS property is written in a separate file with a .css extension and should be linked to the HTML
document using a link tag. External CSS sets styles for elements once and applies them consistently
across multiple web pages, ensuring a unified design.
//The file must not contain any HTML code, and must be saved with a .css extension.
body {
background-color: powderblue;
}
h1 {
color: blue;
}
p{
color: red;
}
Selector forms:
Selectors in CSS are used to select HTML elements based on their element name, id, class, attribute
and many more.
2) CSS Id Selector
The id selector selects the id attribute of an HTML element to select a specific element. An id is always
unique within the page so it is chosen to select a single, unique element.
It is written with the hash character (#), followed by the id of the element.
Example for Id Selector
<html>
<head>
<title>Id selector</title>
<style>
#p1{text-align:center;color:blue;}
</style>
</head>
<body>
<p id="p1">This is a paragraph</p>
<p> Multimedia Animation</p>
</body>
</html>
3)Class Selector
The class selector selects HTML elements with a specific class attribute.
To select elements with a specific class, write a period or dot (.) or full stop symbol followed by the
class name.
Ex:- .p1{text-align:center;color:red;font-style:italic;}
Example for Class Selector:
<html>
<head>
<title>Id selector</title>
<style>
.p1{text-align:center;color:red;font-style:italic:}
</style>
</head>
<body>
<p class="p1">This is a paragraph</p>
<p> Multimedia Animation</p>
</body>
</html>
Output for Class Selector
4)Universal Selector:
Universal selector in CSS is used to select all the elements in an HTML document thatmeans apply to
the whole web page.
Universal selector denoted by an asterisk (*) symbol.
Ex:- *{color:green;font-style:Italic;}
Example for Universal Selector:
<html>
<head>
<title>Id selector</title>
<style>
*{color:blue;font-style:italic}
</style>
</head>
<body>
<p>This is a paragraph</p>
<p> Multimedia Animation</p>
</body>
</html>
Group Selector:
The grouping selector is used to select all the elements with the same style definitions.
Grouping selector is used to minimize the code.
Commas are used to separate each selector in grouping.
Example for Group Selector:
<html>
<head>
<title>Group selector</title>
<style>
h1, h5, p{color:green;font-style:italic;text-align:center;}
</style>
</head>
<body>
<p>This is a paragraph</p>
<h1>Multimedia Animation</h1>
<h5>This is an example for group selector </h5>
</body>
</html>
Keyword values: These are pre-defined values that represent a specific property setting. Keyword
values are not case sensitive.
Ex:- (SMALL, small and small)-all these keywords will have same value.
Length values: Length values are specified as number values that are followed immediately by a two
character abbreviation of a unit name. These specify a length measurement, such as pixels (px), ems
(em) or percentages (%).
Ex:- (width:100px;)-sets the width of an element to 100 pixels.
Color values: Color values specify a color using various formats, such as hexadecimal (#RRGGBB),
RGB value.
Ex:- (background-color: #FF0000;) -sets the background color of an element to red.
URL values: URL values specify a URL for images or other resources. The URL which can be either
absolute or relative, is placed in parenthesis and preceded by URL.
Ex:- background-image: url("[Link]")- sets the background image of an element to [Link].
Function values: These are special values that use a function to calculate a value.
Ex:- transform: rotate(45deg)-rotates an element by 45 degrees using the 'rotate'function.
Multiple values: Some properties allow for multiple values to be specified, separated by commas.
Ex:- (padding:10px 20px 30px 40px;) sets the padding of an element to 10px in top, 20px in right,
30px in bottom and 40px in left.
Font Properties:
• CSS font offer a range of options to style the text content within HTML elements.
• CSS fonts gives the ability to control different aspects of fonts.
Font-family:
The font-family property is used to specify a font of an element.
The browser uses the first font in the value, if not supported by system, it will select the other fonts.
If a font name has more than one word, the whole name should be written within single quotes (‘’).
Ex:- font-family: arial, ‘times new roman’;
Font-size:
Font-size is used to set the font-size of an HTML element.
The font-size can be set in different ways like pixels, points, percentage, etc.
We can also set values like small, large, etc.
Ex:- font-size:10px | 20pt | 50%;
Font-style:
Font-style is used to specify the font style of an HTML element.
Default font-size is normal.
Ex:- font-style: Italic | normal | bold;
Font-weight:
The font-weight property of the CSS is used to set the weight or thickness of the font being used with
the HTML Text. The font-weight applied will depend on font-family used and the browser. For instance,
some font-family is available only in specific weights.
Ex: font-weight: normal|bold|lighter|bolder|number|initial|inherit;
Font-variant:
The default value of the font-variant property is normal, which specifies the usual character font.
In a normal font, the fonts will appears in a sentence case, that is Start letter will becapital and all other
will be small.
In a small-caps font, all lower case letters are converted to uppercase letters appears in a smaller font
size than the original upper letters.
Ex:- font-variant: normal | small-caps | initial;
List Properties:
The list in CSS specifies the listing of the contents or items in a particularmanner.
CSS list has 2 types:-
List-Style-Type Property:
List-Style-Type Property allows us to change the default list type of marker to any other type such
as square, circle, roman numbers, alphabets, etc.
By default the ordered list items are marked by numbers and unordered list items aremarked by disc /
bullets.
list-style-type:decimal;
list-style-type:lower-alpha;
list-style-type:lower-roman;
list-style-type:circle;
list-style-type:square;
list-style-type:disc;
List-Style-Position Property:
List-Style-Position property specifies the position of the list-itemmarkers inside or outside of the box
containing the bullet points.
{List-Style-Position:outside;}-means that the bullet points will beoutside the list item. Outside is the
default position
{List-Style-Position:inside;}- means that the bullet points will be insidethe list item.
List-Style-Image Property:
List-Style-Image allows us to specify an image so that we can use our own bullet style.
The syntax is similar to the background-image property with the letters URL starting the value of the
property followed by the URL in brackets.
If URL does not find the given image then default bullets are displayed.
ul{list-style-image: url('[Link]');} -we need to insert image path inside theURL.
list-style-image: url([Link])
List-Style Property:
List-style Property is a shorthand property that is used to set all list properties in anexpression.
The order of the values of list-style property is type, position and image.
Ex:- {list-style:square inside url('[Link]');}
If any property value is missing, then the default value will be inserted.
Ex:- {list-style:square inside;}
CSS Colors:
• The color property in CSS is used to set the color of HTML elements. Typically, this
property is used to set the background color or the font colorof an element.
• In CSS, we use color values for specifying the color. We can also use thisproperty for
the border-color and other decorative effects.
1 RGB Format:
• RGB format is the short form of 'RED GREEN and BLUE' that is used fordefining the
color of an HTML element simply by specifying the values of R, G, B that are in the
range of 0 to 255.
• The color values in this format are specified by using the rgb() property. This property
allows three values that can either be in percentage or integer(range from 0 to 255).
Syntax : color: rgb(R, G, B);
• For example, rgb(255, 0, 0) is displayed as red, because red is set to its highest
value (255) and the others are set to 0.
• To display black, set all color parameters to 0, like this: rgb(0, 0, 0)
To display white, set all color parameters to 255, like this: rgb(255, 255,255).
2 RGBA Format:
• It is almost similar to RGB format except that RGBA contains A
(Alpha) that specifies the element's transparency. The value of alpha is in therange 0.0 to
1.0, in which 0.0 is for fully transparent, and 1.0 is for not transparent.
Syntax : color:rgba(R, G, B, A);
3 Hexadecimal notation
• Hexadecimal can be defined as a six-digit color representation. This notationstarts with
the # symbol followed by six characters ranges from 0 to F.
• In hexadecimal notation, the first two digits represent the red (RR) color value, the next
two digits represent the green (GG) color value, and the lasttwo digits represent the
blue (BB) color value.
• Syntax: color: #FF0000, #00FF00, #0000FF, #FFFF00
4 HSL
• It is a short form of Hue, Saturation, and Lightness.
• Hue: It can be defined as the degree on the color wheel from 0 to 360. 0 represents
red, 120 represents green, 240 represents blue.
• Saturation: It takes value in percentage in which 100% represents fully saturated, i.e.,
no shades of gray, 50% represent 50% gray, but the color isstill visible, and 0%
represents fully unsaturated, i.e., completely gray, andthe color is invisible.
• Lightness: The lightness of the color can be defined as the light that we wantto provide
the color in which 0% represents black (there is no light), 50% represents neither dark
nor light, and 100% represents white (full lightness).
• Syntax: color:hsl(H, S, L)
5 HSLA
• It is entirely similar to HSL property, except that it contains A (alpha) that specifies the
element's transparency. The value of alpha is in the range 0.0 to1.0, in which 0.0
indicates fully transparent, and 1.0 indicates not transparent.
Syntax: color:hsla(H, S, L, A);
6 Built-in Color
• As its name implies, built-in color means the collection of previously defined colors
that are used by using a name such as red, blue, green, etc.
• Syntax: color: color-name;
Alignment of Text:
• This CSS property is used to set the horizontal alignment of a table-cell boxor the block
element. It is similar to the vertical-align property but in the horizontal direction.
Syntax
text-align: justify | center | right | left ;
Possible values
• justify: It is generally used in newspapers and magazines. It stretches theelement's
content in order to display the equal width of every line.
• center: It centers the inline text.
• right: It is used to align the text to the right.
• left: It is used to align the text to the left.
<Span> tag
• The HTML <span> tag is a generic inline container for inline elements and content.
• It is used to group elements for styling purposes (by using the class or id attributes).
• The span tag is a paired tag means it has both open (<) and closing (>) tags and it ismandatory
to close the tag.
• The tag is an inline element used to apply styles to specific parts of text within a larger
block of content
• It does not create a new line or add any spacing before or after the element.
• The tag is commonly used to apply styles such as font size, font color or text decoration to a
small portion of text within a larger paragraph.
Example for Span tag:
<!DOCTYPE html>
<html>
<body>
<h2>Welcome To India <h2>
<p>Animation refers <span style="color:blue;font-weight:bolder;">to the movement on the screen
</span> of the display device created by displaying <span style="background-color: pink;"> a sequence
of still images.</span> </p>
</body></html>
<Div>tag
• <div> tag is known as the Division tag.
• The div tag is the block-level tag.
• The div tag is used in HTML to make divisions of content in the web page like (text, images,
header, footer, navigation bar, etc).
• Div tag has both open (<div>) and closing (</div>) tags and it is mandatory to closethe tag.
• The Div is the most usable tag in web development because it helps us to separate data in the
web page and we can create a particular section for particular data or function in the web pages.
• It is used for applying styles and layout structure <div> and allows us to manipulateand position
content through CSS.
• It also divides content into logical sections, aiding in the readability and maintainability of the
code.
• As we know a Div tag is a block-level tag, the div tag contains the entire width. Hence, every
div tag will start from a new line and not the same line.
Example for Div tag:
<!DOCTYPE html>
<html>
<style>
div {background-color: pink;}
</style>
<body>
<h1>HTML DIV TAG</h1>
<div>It's a div element</div>
<p>The pink background is added to demonstrate the footprint of the DIV element.</p>
</body>
</html>
Box Model: Every HTML element is a box. The CSS box model helps beginners to understand the
layout and web page design better. The box model consists of several components, such as padding and
margins. CSS sets the position, size, and other properties to these boxes.
2D Transforms: CSS transform is a powerful transformation property. By using its various functions,
like scale, rotate, skew or translate HTML elements. One of the most commonly used functions is CSS
translate which allows you to move elements.
Transitions and Animations: CSS3 provides new properties for creating transitions and animations,
such as transition-property, transition-duration. These properties enable designers to create more
engaging and interactive web.
Background color and image: The background-color property in CSS is used to specify the background
color of an element. The background-image property is used to set one or more background images to
an element. The background-repeat property in CSS is used to repeat the background image both
horizontally and vertically.
JavaScript (JS):
• JavaScript (JS) is the top programming language for web development, used for both
Client-Side and Server-Side purposes.
• JavaScript is also known as a scripting language for web pages.
• JavaScript is a dynamically typed language.
• JS is usually embedded directly into HTML pages.
• JavaScript is commonly used to create dynamic and interactive content on websites.
• JS plays a crucial role in modern web browsers, enabling client-side scripting to modifyweb
page content in real-time, enhancing user experience.
• JavaScript is a lightweight, cross-platform, single-threaded and interpreted compiled
programming language.
Syntactic Characteristic
• JavaScript can be implemented using JavaScript statements that are placed within the
<script>
...
</script>
• HTML tags in a web page.
• You can place the <script> tags, containing your JavaScript, anywhere within your web page, but
it is normally recommended that you should keep it within the <head> tags.
• The <script> tag alerts the browser program to start interpreting all the text between these tags as
a script.
Primitive data types: The predefined data types provided by JavaScript language are known as
primitive data types. Primitive data types are also known as in-built data types.
Number: Number data type in JavaScript can be used to hold decimal values as well as values without
decimals.
String: The string data type in JavaScript represents a sequence of characters that are surrounded by
single or double quotes.
Boolean: The Boolean data type can accept only two values i.e. true and false.
Undefined: The meaning of undefined is ‘value is not assigned’.
Null: This data type can hold only one possible value that is null.
BigInt: This data type can represent numbers greater than 253-1 which helps to perform operations on
large numbers. The number is specified by writing ‘n’ at the end of the value
Symbol: This data type is used to create objects which will always be unique. these objects can be created
using Symbol constructor.
Non-primitive data types: The data types that are derived from primitive data types of the JavaScript
language are known as non-primitive data types. It is also known as derived data types or reference data
types.
Object: An object in JavaScript is an entity having properties and methods. Everything is an object in
JavaScript.
Array: With the help of an array, we can store more than one element under a single name.
+ Addition 10+20 = 30
- Subtraction 20-10 = 10
/ Division 20/10 = 2
The JavaScript comparison operator compares the two operands. The comparison operators are as
follows:
The bitwise operators perform bitwise operations on operands. The bitwise operators are as follows:
= Assign 10+10 = 20
Operator Description
(?:) Conditional Operator returns value based on the condition. It is like if-else.
, Comma Operator allows multiple expressions to be evaluated as single statement.
Using innerHTML
• The id attribute defines the HTML element. The innerHTML property defines
the HTML content:
<html>
<body>
<h1>My First Web Page</h1>
<p>My First Paragraph</p>
<p id="demo"></p>
<script> [Link]("demo").innerHTML = 5 + 6;
</script>
</body>
</html>
Using [Link]()
For testing purposes, it is convenient to use [Link]():
<html>
<body><h1>My First Web Page</h1>
<p>My first paragraph.</p>
<script> [Link](5 + 6);
</script>
</body>
</html>
Using [Link]()
• You can use an alert box to display [Link] can skip the window
[Link] JavaScript, the window object is the global scope object.
• This means that variables, properties, and methods by default belong to
the window object. This also means that specifying the window
keyword is optional:
<html>
<body>
<h1>My First Web Page</h1>
<p>My first paragraph.</p>
<script> [Link](5 + 6);
</script>
</body>
</html>
Using [Link]()
For debugging purposes, you can call the [Link]() method in the browser
to display data.
<!DOCTYPE html>
<html>
<body>
<script> [Link](5 + 6);
</script>
</body>
</html>
Animation:
• An animation is nothing more than a visualization of change
• Animation is a method by which still figures are manipulated to appear as moving
images.
• A change that occurs over a period of time.
You start off with a blue circle that is small and located to the left of the screen. At the end
state, your blue circle now looks like this:
The Start state is the initial style of the element before the animation begins ,while the end
state is the final style of the element after the animation completes.
One change is the position. Our blue circle starts off on the left side of the page.
In the end, it is located on the right hand side. Another change is the size. The blue circle
became several times larger in the end state compared to its initial size at the beginning.
Interpolation:
Interpolation is the fancy name given to the intermediate states are generated between your
start and end states.
Interpolation in CSS refers to the process of smoothly transitioning between two or more
CSS property values over a specified duration using keyframes and animation properties.
• To create an animation with interpolation in CSS, you need to define the start and end
states of an element using CSS properties.
• Then, you use keyframes to define intermediate states of the animation, specifying the
CSS properties for each state.
• Finally, you use the animation property to apply the animation to the element,
specifying the duration, timing function, delay, and other properties.
Animation in HTML:
• An animation lets an element gradually change from one style to another. You can
change as many CSS properties you want, as many times as you want.
• To create animations in HTML we can use CSS or JavaScript here are some ways to
create animations using both methods
1. CSS Animations
2. JavaScript Animations
1 CSS Animations:
CSS animations allow you to create animations using only CSS code. You can define the
animation properties such as duration, timing function, and keyframes. Here is an example
of a CSS animation:
Example:
<html>
<head>
<style>
div {
width: 100px;
height: 100px;
background-color: red;
animation-name: example;
animation-duration: 4s;
}
@keyframes example {
from {background-color: red;}
to {background-color: yellow;}
}
</style>
</head>
<body>
<h1>CSS Animation</h1>
<div></div>
<p><b>Note:</b> When an animation is finished, it goes back to its original style.</p>
</body>
</html>
2 JavaScript Animations:
JavaScript can also be used to create animations in HTML. You can use JavaScript to
manipulate CSS properties, create custom animations, and control the timing of the animation.
Here is an example of a JavaScript animation
<!DOCTYPE html>
<html>
<style>
#container {
width: 400px;
height: 400px;
position: relative;
background: yellow;
}
#animate {
width: 50px;
height: 50px;
position: absolute;
background-color: red;
}
</style>
<body>
<p><button onclick="myMove()">Click Me</button></p>
<div id ="container">
<div id ="animate"></div>
</div>
<script>
function myMove() {
let id = null;
const elem = [Link]("animate");
let pos = 0;
clearInterval(id);
id = setInterval(frame, 2);
function frame() {
if (pos == 350) {
clearInterval(id);
} else {
pos++;
[Link] = pos + "px";
[Link] = pos + "px";
}
}
}
</script>
</body></html>