abs method
returns the absolute value of a number.
语法
math.abs(number)
number is any numeric expression or a property of an existing object.
用法
例子
in the following example, the user enters a number in the first text box and presses the calculate button to display the absolute value of the number.
<form> <p>enter a number: <input type="text" name="absentry"> <p>the absolute value is: <input type="text" name="result"> <p> <input type="button" value="calculate" onclick="form.result.value = math.abs(form.absentry.value)"> </form>
acos method
returns the arc cosine (in radians) of a number.
语法
math.acos(number)
number is a numeric expression between -1 and 1, or a property of an existing object.
用法
描述
the acos method returns a numeric value between 0 and pi radians. if the value of number is outside the suggested range, the return value is always 0.
例子
// displays the value 0
document.write("the arc cosine of 1 is " + math.acos(1))
// displays the value 3.141592653589793
document.write("<p>the arc cosine of -1 is " + math.acos(-1))
// displays the value 0
document.write("<p>the arc cosine of 2 is " + math.acos(2))
see also
action property
a string specifying a destination url for form data that is submitted.
语法
formname.action
formname is either the name of a form or an element in the forms array.
property of
描述
the action property is a reflection of the action attribute of the <form> tag. each section of a url contains different information. see the location object for a 描述 of the url components.
you can set the action property at any time.
certain values of the action property may require specific values for other form properties. see rfc 1867 for more information.
例子
the following example sets the action property of the musicform form to the value of the variable urlname:
document.musicform.action=urlname
see also
alert method
displ