HTML and CSS Reference
In-Depth Information
JavaScript Element
Description
locationƒ
The location of the document
Properties
hash
The location's anchor name
host
The location's hostname and port number
href
The location's URL
pathname
The path portion of the location's URL
port
The port number of the location's URL
protocol
The protocol used with the location's URL
search
The query portion of the URL
Methods
assign(
url
)
Assigns the URL in the string
url
to the object
reload()
Reloads the location
replace(
url
)
Loads a new location with the address
url
Mapƒ
A client-side image map in the document
Properties
areas
A collection of
areas enclosed by the object
name
A string holding the name of the image map
Mathƒ
An object used for advanced mathematical calculations
Properties
E
The value of the base of natural logarithms (2.7182...)
LN10
The value of the natural logarithm of 10
LN2
The value of the natural logarithm of 2
LOG10E
The base 10 logarithm of E
LOG2E
The base 2 logarithm of E
PI
The value of pi (3.1416...)
The square root of
1
/
2
SQRT1_2
SQRT2
The square root of 2
Methods
abs(
number
)
Returns the absolute value of
number
acos(
number
)
Returns the arc cosine of
number
in radians
asin(
number
)
Returns the arc sine of
number
in radians
atan(
number
)
Returns the arc tangent of
number
in radians
atan2()
Returns the arc tangent of the quotient of its arguments
ceil(
number
)
Rounds
number
up to the next-highest integer
cos(
number
)
Returns the cosine of
number
, where
numbe
r is an angle expressed in radians
exp(
number
)
Raises the value of E (2.7182...) to the value of
number
floor(
number
)
Rounds
number
down to the next-lowest integer
log(
number
)
Returns the natural logarithm of
number
max(
number1, number2
)
Returns the greater of
number1
and
number2
min(
number1, number2
)
Returns the lesser of
number1
and
number2
pow(
number1, number2
)
Returns the value of
number1
raised to the power of
number2
random()
Returns a random number between 0 and 1
round(
number
)
Rounds
number
to the closest integer