How to position an element relative to its normal position.
<html>
<head>
<style type=”text/css”>
h2.pos_abs (more…)
How to position an element relative to its normal position.
<html>
<head>
<style type=”text/css”>
h2.pos_abs (more…)
How to display an element as an inline element.
<html>
<head>
<style type=”text/css”>
p {display: inline}
div {display: none}
</style>
</head> (more…)
Very often when you write code, you want to perform different actions for different decisions. You can use conditional statements in your code to do this.
In JavaScript we have the following conditional statements:
if statement - use this statement if you want to execute some code only if a specified condition is true
Let’s look at some examples.
eg. 1
var a = 5;var b = 5;
if (a == b)
{
alert("The two quantities are equal");
}
eg. 2 (more…)
An operator is a symbol which helps the user to command the computer to do a certain mathematical or logical manipulations. Operators are used in the program to operate on data and variables.
Arithmetic Operators
Arithmetic operators work on one or more numeric values yielding a single result.
+ Addition
- Subtraction
* Multiplication
/ Division
% Modulus
++ Increment by 1
– Decrement by 1 (more…)