DIT 2nd Semester Web Developement
DIT 2nd Semester Web Developement
HTML Lists: HTML Lists are used to specify lists of information. All lists
may contain one or more list elements. There are three different types of
HTML lists:
1. Ordered List or Numbered List (ol)
2. Unordered List or Bulleted List (ul)
3. Description List or Definition List (dl)
Note: we can create list Inside another list, which will be termed as
nested list.
1.HTML Ordered List or Numbered List (ol):
Ordered List or Numbered List displays elements in numbered format. The
HTML ol tag is used for ordered list. We can use ordered list to represent items
either in numerical order format or alphabetical order format, or any format
where an order is emphasized. There can be different types of numbered list:
o Numeric Number (1, 2, 3)
o Capital Roman Number (I II III)
o Small Romal Number (i ii iii)
o Capital Alphabet (A B C)
o Small Alphabet (a b c)
For-Example:
Output:
1. Aries
2. Bingo
3. Leo
4. Oracle
The definition list is very appropriate when you want to present glossary, list
of terms or other name-value list.
1. Client-Side
4 Made By:Maryam Ayub
2. Server-side
❖ Client - Side Language:
Css: CSS stands for Cascading Style Sheets
✓ CSS describes how HTML elements are to be displayed on screen,
in other media paper
✓ CSS saves a lot of work. It can control the layout of multiple web pages
all at once
✓ External stylesheets are stored in CSS files.
Html: Hyper Text Markup Language (HTML) is the main markup language
for creating web pages and other information that can be displayed in a web
browser.
❖ Server-side :
bash: It is a scripting language that's the default command
interpreter on most GNU/Linux systems and can be found on a
variety of operating systems. As compared to other programming
languages, the use of bash is much easier to create scriptsIt stores
documentation for others to use, defines the tools to use and
command line code, and provides useful reusable scripts. Its name is
short for 'Bourne-Again SHell'.
Python: It is an object-oriented programming language that is the
most widely used language among developers, in modern times. It is
simple and interpreted. It's a dynamically semantic language with
enormous scripted lines of code. It has high-level data structures
built in, making it easy to use and suitable for Rapid Application
Development. It supports code reuse and software modularity by
allowing modules and packages.
Q3. What is operator? Explain different types of
operators which are used in java script?(2016)
Ans:
Operator:
An operator is capable of manipulating a certain value or operand. Operators
are used to perform specific mathematical and logical computations on
2 - (Subtraction)
Subtracts the second operand from the first
Ex: A - B will give -10
3 * (Multiplication)
Multiply both operands
Ex: A * B will give 200
4 / (Division)
Divide the numerator by the denominator
Ex: B / A will give 2
5 % (Modulus)
Outputs the remainder of an integer division
Ex: B % A will give 0
6 ++ (Increment)
Increases an integer value by one
7 -- (Decrement)
Decreases an integer value by one
Ex: A-- will give 9
Note −Addition operator (+) works for Numeric as well as Strings. e.g. "a" +
10 will give "a10".
2. Comparison Operator:
JavaScript supports the following comparison operators −
Assume variable A holds 10 and variable B holds 20, then −
Sr.No Comparison Operator
1 = = (Equal)
Checks if the value of two operands are equal or not, if yes, then the
condition becomes true.
Ex: (A == B) is not true.
2 != (Not Equal)
Checks if the value of two operands are equal or not, if the values are not
equal, then the condition becomes true.
Ex: (A != B) is true.
3 > (Greater than)
Checks if the value of the left operand is greater than the value of the right
operand, if yes, then the condition becomes true.
Ex: (A > B) is not true
4 < (Less than)
Checks if the value of the left operand is less than the value of the right
operand, if yes, then the condition becomes true.
Ex: (A < B) is true.
5 >= (Greater than or Equal to)
Checks if the value of the left operand is greater than or equal to the value
of the right operand, if yes, then the condition becomes true.
Ex: (A >= B) is not true.
3. Logical Operator:
JavaScript supports the following logical operators −
Assume variable A holds 10 and variable B holds 20, then –
Sr.No Logical Operator
1 && (Logical AND)
If both the operands are non-zero, then the condition becomes true.
Ex: (A && B) is true.
2 || (Logical OR)
If any of the two operands are non-zero, then the condition becomes true.
Ex: (A || B) is true
3 ! (Logical NOT)
Reverses the logical state of its operand. If a condition is true, then the Logical
NOT operator will make it false.
Ex: ! (A && B) is false.
4. Assignment Operator:
JavaScript supports the following assignment operators –
Sr.No Assignment Operator
1 = (Simple Assignment )
Assigns values from the right side operand to the left side operand
Ex: C = A + B will assign the value of A + B into C
Note − Same logic applies to Bitwise operators so they will become like
<<=, >>=, >>=, &=, |= and ^=
Html allow event handler attributes, with java script code, to be added to
Html elements.
Events Description
Onchange An HTML element has been changed
14 Made By:Maryam Ayub
Onclick The user clicks an HTML element
Onmouseout The user moves the mouse away from an HTML element
<head>
<tittle>javascript</title>
</head>
<form>
<table>
<tr>
<td>
<label>username</label>
</td>
<td>
15 Made By:Maryam Ayub
<input type=”text”>< br >
</td>
</tr>
<tr>
<td>
<label>password</label>
</td>
<td>
<input type=”text”>
</td>
</tr>
<tr>
<button>login</button>
</td>
</tr>
</body>
</html>
Password
Login
To create a two-dimensional array, add each array within its own set of curly
braces:
Example:
int[][] myNumbers = { {1, 2, 3, 4}, {5, 6, 7} };
To access the elements of the myNumbers array, specify two indexes: one for
the array, and one for the element inside that array.
For-example
Img {
position: absolute;
left: 0px;
top: 0px;
z-index: -1;
Example
function my Function(p1, p2) {
Function names can contain letters, digits, underscores, and dollar signs
(same rules as variables).
{ code to be executed }
Inside the function, the arguments (the parameters) behave as local variables.
<li>Burger
<ul>
<li>zinger</li>
<li>cheese </li>
<li>Egg </li>
</ul>
</li>
<ul>
<li>vanilla</li>
<li>Tuti Fruity</li>
</ul>
</li>
<ul>
<li>7 up </li>
<li> Dew</li>
<li>Pepsi </li>
</ul>
</li>
<ul>
<li>Nestle </li>
<li>Olper </li>
</ul>
</li>
<head>
<title> Classes</title>
<style>
.one{ background-color:red;
width:100px;
margin:50px;
padding:50px;
.two { background-color:green;
width:110px;
margin:60px;
padding:60px;
width:120px;
margin:70px;
padding:70px;
width:130px;
padding:80px;
width:140px;
margin:90px;
padding:90px;
</style>
</head>
<body>
</body>
</html>
In the other words: The Html DOM is a standard for how to get ,Change, add
,or delete Html elements.
With the Html DOM ,javascript can access and change all the elements of an
Html document.
When a web page is loaded ,the browser creates a document Object Model of
the page.The HTML DOM Model of the page .The HTML DOM model is
constructed as a tree of object.
Document
Root element:
<html>
<head> <html>
With the object model, java script gets all the power it needs to create
dynamic Html.
✓ Java script can change all the html elements in the page.
✓ Java script can change all the html attribute in the page.
✓ Java script can change all css styles in the page.
✓ Java script can remove existing html elements and attributes.
✓ Java script can add new html elements and attributes .
✓ Java script react to all existing html events in the page.
✓ Java script can create new html events in the page.