Applied Computing Notes - 2024
Applied Computing Notes - 2024
2ND SEMESTER
UNIT 1:
1. Markup Languages:
Markup languages are used to annotate text or data to provide structure and
formatting instructions.
They consist of tags or elements that define how the content should be displayed
or processed.
Examples of markup languages include HTML, XML, and Markdown.
2. Introduction to HTML5:
HTML5 is the latest version of Hypertext Markup Language.
It is used to structure and present content on the web.
HTML5 introduces new elements, attributes, and APIs to enhance the capabilities
of web pages.
3. Development Environment Setup:
To start developing with HTML, you need a text editor such as Notepad++ or
Sublime Text.
Save your HTML files with a .html extension.
You can open HTML files in a web browser to view the rendered output.
4. Anatomy of an HTML Tag:
HTML tags are used to define elements in an HTML document.
Tags are enclosed in angle brackets (< >) and usually come in pairs, with an
opening and closing tag.
The opening tag starts with a tag name and can contain attributes that provide
additional information about the element.
5. Basic Structure of HTML Document:
An HTML document starts with the <!DOCTYPE html> declaration, which specifies
the HTML version.
The <html> element is the root element and contains all other elements in the
document.
The <head> element includes meta-information about the document and links to
external resources.
The <body> element contains the visible content of the webpage.
6. HTML Content Models:
HTML elements have different content models that define what can be placed
inside them.
UNIT 2:
1. Need for CSS:
CSS (Cascading Style Sheets) is a styling language used to describe the look and
formatting of a document written in HTML.
It separates the presentation of a web page from its structure, allowing for easy
maintenance and consistent design across multiple pages.
CSS provides control over various aspects of a webpage, such as fonts, colors, layouts,
and more.
Inline CSS: Styling applied directly to HTML elements using the "style" attribute.
Internal CSS: CSS rules placed within the "style" tags in the head section of an HTML
document.
External CSS: CSS rules stored in a separate file and linked to the HTML document using
the "link" tag.
A CSS rule consists of a selector and one or more declarations enclosed in curly braces.
The selector specifies the HTML element(s) to which the styles will be applied.
Declarations consist of a property and a value, separated by a colon.
Element selectors target specific HTML elements by their tag name (e.g., "p", "h1", "div").
5. Combining selectors:
Multiple selectors can be combined to apply styles to elements that meet certain
criteria.
Comma-separated selectors select multiple elements (e.g., "h1, h2").
Space-separated selectors apply styles to elements that are descendants of another
element (e.g., "div p").
6. Pseudo-Class Selectors:
Pseudo-classes select elements based on their state or position within the document
structure.
Examples include ":hover" (applied when the element is being hovered over) and ":nth-
child(n)" (selects elements based on their position).
Styles can be placed inline, internally, or externally, with different levels of specificity and
importance.
In case of conflicting styles, the cascading nature of CSS determines which style takes
precedence.
Specificity, order of declaration, and use of !important can affect conflict resolution.
9. Web fonts:
Web fonts allow the use of custom fonts on web pages, overcoming the limitation of
relying on user-installed fonts.
Fonts can be linked from external sources or stored locally and used through the @font-
face rule.
Browser developer tools (e.g., Chrome DevTools) provide a set of debugging and editing
tools for web developers.
They allow inspecting and modifying HTML and CSS properties in real-time, facilitating
debugging and experimentation.
The box model describes how elements are rendered on the page, including their
content, padding, border, and margin.
The background property sets the background color or image of an element.
The margin property controls the space outside an element.
The padding property defines the space between an element's content and its border.
The float property controls how an element flows within its container.
The z-index property determines the stacking order of overlapping elements.
UNIT 3:
1. Introduction to JavaScript:
Inline: JavaScript code can be written directly within the HTML file using the <script>
tag with the src attribute.
External: JavaScript code can be placed in a separate .js file and linked to the HTML file
using the <script> tag with the src attribute.
3. JS Identifiers:
Identifiers are names used to identify variables, functions, objects, or any other user-
defined items.
They can include letters, digits, underscores, and dollar signs.
Identifiers must start with a letter, underscore, or dollar sign (cannot start with a digit).
4. Reserved Words:
Reserved words are words that have predefined meanings in JavaScript and cannot be
used as identifiers.
Examples of reserved words include var, function, if, else, for, while, break,
continue, etc.
5. Optional Semicolons:
In JavaScript, semicolons are used to separate statements. However, they are often
optional.
6. Comments:
Comments are used to add explanatory notes to the code. They are ignored by the
JavaScript interpreter.
Single-line comments start with //, while multi-line comments are enclosed between /*
and */.
7. Literals:
Literals are fixed values that are directly written into the code.
Examples of literals include numbers, strings, booleans, arrays, objects, and regular
expressions.
JavaScript has several built-in data types, including number, string, boolean, null,
undefined, object, and symbol.
Values are the actual data assigned to variables or used in expressions.
Variables are used to store and manipulate values. They are declared using the var, let,
or const keywords.
const is used to declare variables that cannot be reassigned after they are initialized.
let is used to declare variables with block scope that can be reassigned.
var is the old way of declaring variables, with function scope.
Expressions are combinations of values, variables, and operators that produce a new
value.
JavaScript has various types of operators, including arithmetic, relational, logical,
assignment, and evaluation operators.
Conditionals allow you to make decisions in your code based on certain conditions.
The if statement executes a block of code if a specified condition is true.
The else if statement provides an alternative condition to be checked if the previous
condition is false.
The switch statement allows you to select one of many code blocks to be executed
based on different cases.
Loops are used to execute a block of code repeatedly until a specific condition is met.
The while loop executes a block of code while a specified condition is true.
The for loop allows you to specify initialization, condition, and iteration in a single line.
In JavaScript, functions are treated as first-class objects, which means they can be
assigned to variables, passed as arguments, and returned from other functions.
Functions can be used as values and stored in variables or properties.
UNIT 4:
1. Objects:
Creating objects: Objects in JavaScript can be created using the object literal
notation or the constructor function.
Querying and setting properties: Properties of an object can be accessed and
modified using dot notation or square brackets.
Deleting and testing properties: The delete keyword can be used to remove a
property from an object. The in operator can be used to check if a property
exists in an object.
Serializing objects: Objects can be serialized into a JSON string using
JSON.stringify().
2. Arrays:
Creating arrays: Arrays in JavaScript can be created using array literal notation or
the Array() constructor.
Reading and writing arrays: Array elements can be accessed or modified using
their index.
Array length: The length property of an array returns the number of elements in
the array.
Iterating arrays: Arrays can be iterated using loops such as for loop or array
methods like forEach().
Strings as arrays: In JavaScript, strings can be treated as arrays of characters.
Individual characters can be accessed using square brackets and index.
3. The Document Object Model (DOM):
The DOM represents the structure of an HTML document and provides a way to
interact with it using JavaScript.
Elements in the DOM are organized in a tree-like structure with the document
object at the top.
DOM manipulation allows adding, modifying, or removing HTML elements
dynamically.
4. Program input and output:
Input: JavaScript programs can take user input using prompts, forms, or by
accessing DOM elements.
Output: JavaScript programs can display output using console.log(), alert(),
or by modifying the content of HTML elements.
5. Browser events and event handling: