Industrial Report On Web Development
Industrial Report On Web Development
on
“Web Components Using JavaScript”
Submitted in partial fulfilment for
the award of the Degree of
Bachelor of Technology
in
Department of Computer Science & Engineering
I declare that the work presented in this report titled “Web Development in JavaScript”,
submitted to the Computer Science and Engineering Department, Modern Institute of
Technology and Research Centre, Alwar, for the award of Bachelor of Technology degree
in Computer Science and Engineering, is my original work. I have not plagiarized or
submitted the same work for the award of any other degree. In case this undertaking is
found incorrect, I accept my mistake.
Firstly, I would like to express my gratitude to my advisor for the beneficial comments and
remarks.
I express my sincere thanks to Prof. S. K. Sharma (Director), Modern Institute of
Technology and Research Centre, Alwar and Dr. NK Yadav, Dean of Academics, Modern
Institute of Technology and Research Centre, Alwar.
I pay my deep sense of gratitude to Dr. J.R Arun Kumar (HOD) of CSE department, Modern
Institute of Technology and Research Centre, Alwar to encourage me to the highest peak
and to provide me the opportunity to present the seminar.
I feel to acknowledge my indebtedness and deep sense of gratitude to my guide Mr. Rahul
Shandilya, Assistant Professor (CSE Department) whose valuable guidance and kind
supervision given to me.
I am immensely obliged to my friends for their elevating inspiration, encouraging guidance
and kind supervision.
Last, but not the least, my parents are also an important inspiration for me. So, with due
regards, I express my gratitude to them.
Ritika Khandelwal
20EMCCS106
Certificate
Certified that this project report “Web Components Using JavaScript”is the original work
of “Ritika Khandelwal” student of B. Tech. Third Year, V-Semester (CSE) who carried out
the project work under my supervision.
SIGNATURE SIGNATURE
Dr. J.R. Arunkumar Mr. Rahul Shandilya
HEAD OF THE DEPARTMENT SUPERVISOR
CSE Dept, MITRC, Alwar Assistant Prof, CSE
CSE Dept, MITRC, Alwar
Contents
Undertaking......................................................................................................ii
Acknowledgment.............................................................................................iii
Certificate.........................................................................................................iv
Table of Content...............................................................................................v
List of Table....................................................................................................vii
List of Figures.................................................................................................vii
Chapter-1 HTML Tutorial..............................................................................1
1.1 Introduction.....................................................................................................................1
1.2 Getting Started With HTML...........................................................................................1
1.3 Line Break.......................................................................................................................1
1.4 Comments in HTML.......................................................................................................2
1.5 Special Character............................................................................................................2
Chapter-2 Attributes in HTML......................................................................3
2.1 Aling Attribute................................................................................................................3
2.2 Core Attribute.................................................................................................................3
2.2.1 ID Attribute........................................................................................................4
2.2.2 The Title Attribute.............................................................................................4
2.3 Bold Text........................................................................................................................4
2.4 Italic Text........................................................................................................................5
2.5 Underlined Text..............................................................................................................5
Chapter-3 Introduction to CSS.......................................................................7
3.1 Introduction.....................................................................................................................7
3.2 Selector in CSS...............................................................................................................7
3.3 Hierarchy in CSS............................................................................................................8
Chapter-4 Overview of Java Script................................................................9
4.1 About Java Script............................................................................................................9
4.2 Client-Side Java Script....................................................................................................9
4.3 Advantages......................................................................................................................9
4.4 Limitation of Java Scripts.............................................................................................10
Chapter-5 JavaScript Variable.....................................................................11
5.1 Java Script Datatypes....................................................................................................11
5.2 Java Script Variable......................................................................................................11
5.3 Java Script Variable Scope...........................................................................................11
5.4 Java Script Variable Name...........................................................................................12
Chapter-6 Syntaxes of Java Script...............................................................13
6.1 Case Sensitive..............................................................................................................13
6.2 Comments in Java Script..............................................................................................13
6.3 White space in Java Script............................................................................................14
Project-1 BMI CALCULATOR....................................................................15
HTML CODE...................................................................................................15
CSS CODE.......................................................................................................15
JS CODE...........................................................................................................16
FUTURE SCOPE...........................................................................................19
CONCLUSION...............................................................................................20
REFERENCE..................................................................................................21
List of Table & Figures
HTML Tutorial
1.1 Introduction
Hypertext Markup Language (HTML) is one of the three main components of modern webpages, along
with Cascading Style Sheets (CSS) and JavaScript. HTML indicates to the browser what elements should
be included in the webpage (and in what order). CSS indicates how each element should be styled.
JavaScript provides a means for webpage authors to manipulate these elements programmatically and in
response to actions by the end user. Tutorials and reference material covering all three components are
available here.
In these pages, we describe HTML further. Text used within HTML, CSS or JavaScript files is generally
shown in courier new (i.e. a fixed space) font. The pages contain links to an extensive body of reference
material explaining HTML, CSS and JavaScript in detail.
The markup used by HTML includes tags, like <p>…</p>, to demarcate different HTML elements within
the same webpage. In this case the <p> tag opens the relevant element and the </p> closes it.
<p> elements are typically used to delimit paragraphs in HTML.
HTML elements can be nested within other elements. Most elements can also be qualified by a range of
attributes. For example, if we want to make the text within a <p> element appear red we can ascribe it a
CSS style, along the lines of <p style="color:red;">.
1.2 Getting Started with HTML
As explained in HTML and other markup languages, there are various ‘dialects’ of HTML. This means
that some examples of HTML may be understood by some browsers but rejected by others. The following
text, when put into a text editor and saved with a .html file extension, will usually successfully render a
web page that says “Hello World (using HTML)” if the file is viewed in Microsoft Edge.
Note that HTML largely ignores page breaks; if you want to include a page break in the text shown to the
user then you need to add a <br> element (or a <br /> element if you are using XHTML, which is a modern
variant of HTML that involves a cross between classic HTML and XML).
Example
<html>
<body>
Hello World (using HTML)
</body>
</html>
Leading spaces (i.e. ones on a line before any non-space characters) are typically ignored, as are trailing
spaces (i.e. ones on a line after the last non-space character). However, browsers typically insert a 'breaking
space' at the end of each line, which often then shows up as a single space. Multiple spaces one after the
other are interpreted as a single space. To include more than one space in such instances you need to include
a ‘non-breaking space’ as a special character.
space (technically a ‘non-breaking’ space) (e.g. in Hello again) (e.g.as in Hello again)
We have seen few HTML tags and their usage like heading tags <h1>, <h2>, paragraph tag <p> and other
tags. We used them so far in their simplest form, but most of the HTML tags can also have attributes, which
are extra bits of information.
An attribute is used to define the characteristics of an HTML element and is placed inside the element's
opening tag. All attributes are made up of two parts: a name and a value:
The name is the property you want to set. For example, the paragraph <p> element in the example carries
an attribute whose name is align, which you can use to indicate the alignment of paragraph on the page.
The value is what you want the value of the property to be set and always put within quotations. The below
example shows three possible values of align attribute: left, centre and right.
2.2.1 ID Attribute
The id attribute of an HTML tag can be used to uniquely identify any element within an HTML page. There
are two primary reasons that you might want to use an id attribute on an element:
If an element carries an id attribute as a unique identifier, it is possible to identify just that element and its
content.
If you have two elements of the same name within a Web page (or style sheet), you can use the id attribute
to distinguish between elements that have the same name.
Output:
The following word uses an underlined typeface.
Chapter-3
Introduction to CSS
3.1 Introductions
Cascading Style Sheets (CSS) is one of the three main components of modern webpages, along with
Hypertext Markup Language (HTML) and JavaScript. HTML indicates to the browser what elements
should be included on the page (and in what order). CSS indicates how each should be styled. JavaScript
provides a means for webpage authors to manipulate these elements programmatically and in response to
actions by the end user.
CSS instructions can be:
(a) included within an individual HTML element (as part of the mark-up relating to that element), i.e. as
‘in-line’ CSS
(b) included in the HTML file where the relevant element(s) are located, but not directly within the
elements concerned, i.e. as ‘in-file’ CSS
(c) included in external CSS files, i.e. as ‘external’ CSS, with a HTML <link> element used to indicate
where any such CSS files applicable to a given HTML file are located.
Fig 5.2.1 declare multiple variables with the same var keyword
JavaScript is untyped language. This means that a JavaScript variable can hold a value of any data type.
Unlike many other languages, you don't have to tell JavaScript during variable declaration what type of
value the variable will hold. The value type of a variable can change during the execution of a program
and JavaScript takes care of it automatically.
• You should not use any of the JavaScript-reserved keywords as a variable name. These keywords
are mentioned in the next section. For example, break or Boolean variable names are not valid.
• JavaScript variable names should not start with a numeral (0-9). They must begin with a letter or
an underscore character. For example, 123test is an invalid variable name but _123test is a valid
one.
• JavaScript variable names are case-sensitive. For example, Name and name are two different
variables.
Chapter-6
Syntaxes of Java Script
Java Script 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 you 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.
A simple syntax of your JavaScript will appear as follows.
<script ...>
Java Script code
</script>
BMI Calculator:
HTML CODE:
CSS CODE:
JS CODE:
OUTPUT:
HTML CODE:
CSS CODE:
JS CODE:
OUTPUT:
1. Web Developers Are Always Learning- Technology changes quickly, which means Web Developers
have to stay on top of any important new programming language, web development software, or trend.
Even coding experts with advanced computer science degrees will need to continually upskill in this field
to stay ahead.
2. CMS- The scope of web development encompasses all related development activities, such as client-
side scripting, server-side scripting, server and network security settings, ecommerce development, and
content management system (CMS) development, in addition to web markup and code.
3. Key Skill- Key skills to be successful in web development include:
❖ Computer literacy.
❖ Attention to detail.
The end of this module brought with it new techniques and tools for:
• organizing websites
• identifying & grouping specific elements within websites
• including & embedding multi-media content
• adding metadata to further define our webpages
At this point, you should be feeling comfortable with HTML and the ways that this markup language allows
developers and content creators to build and create webpages.
Starting in week-3, we have started with the absolute basics of HTML and moved through many topics
showing you how to leverage this language for content structuring and presentation. As with any new
language, your comfort level and familiarity with HTML will increase with practice and use. This not only
includes your own writing of webpages with HTML, but the necessary step of reading other’s HTML to
understand how they use the language to present content and solve problems. This latter task is greatly
facilitated by the open nature of the Internet, and the fact that all content is sent as documents to your web
browser, allowing you to view others source code.
Remember to stay patient with yourself as you assimilate all of this new information you have learned and
begin to create you own webpages. Learning a new language is not an easy task.
For your homework, you will be asked to practice the specific topics presented this week, while continuing
to incorporating techniques introduced the previous four weeks.
As you work on your assignments for the week, pay particular attention to:
• structure
• legibility
• clarity
• readability
This also means spending time thinking about grouping similar types of elements and identifying
particularly important elements with the use of the id and class attributes. This is a crucial step to increased
structural organization of your documents. This will be particularly true as we start looking at how to style
our documents. Spending time thinking about clarity, readability, efficiency, understandability of
organization this will pay dividends in future
References
1 https://www.w3schools.com/html/
2 https://www.w3schools.com/html/html_css.asp
3 https://www.javatpoint.com/html-tutorial
4 https://www.javatpoint.com/html-tags
5 https://www.javatpoint.com/css-tutorial
6 https://developer.mozilla.org/en-US/docs/Web/JavaScript