分享
 
 
 

javascript手冊-b

王朝html/css/js·作者佚名  2006-01-08
窄屏简体版  字體: |||超大  

back method

Loads the previous URL in the history list.

语法history.back()

用法

history

描述

This method performs the same action as a user choosing the Back button in the Navigator. The back method is the same as history.go(-1).

例子The following custom buttons perform the same operations as the Navigator Back and Forward buttons: <P><INPUT TYPE="button" VALUE="< Back"

onClick="history.back()">

<P><INPUT TYPE="button" VALUE="> Forward"

onClick="history.forward()">

See also

forward, go methods

bgColor property

A string specifying the color of the document background.

语法document.bgColor

Property of

document

描述

The bgColor property is expressed as a hexadecimal RGB triplet or as one of the string literals listed in Color Values. This property is the JavaScript reflection of the BGCOLOR attribute of the <BODY> tag. The default value of this property is set by the user on the Colors tab of the Preferences dialog box, which is displayed by choosing General Preferences from the Options menu.

You can set the bgColor property at any time.

If you express the color as a hexadecimal RGB triplet, you must use the format rrggbb. For example, the hexadecimal RGB values for salmon are red=FA, green=80, and blue=72, so the RGB triplet for salmon is "FA8072".

例子

The following example sets the color of the document background to aqua using a string literal: document.bgColor="aqua"

The following example sets the color of the document background to aqua using a hexadecimal triplet: document.bgColor="00FFFF"

See also

alinkColor, fgColor, linkColor, and vlinkColor properties

big method

Causes a string to be displayed in a big font as if it were in a <BIG> tag.

语法stringName.big()

stringName is any string or a property of an existing object.

用法

string

描述

Use the big method with the write or writeln methods to format and display a string in a document.

例子The following example uses string methods to change the size of a string: var worldString="Hello, world"

document.write(worldString.small())

document.write("<P>" + worldString.big())

document.write("<P>" + worldString.fontsize(7))

The previous example produces the same output as the following htm: Hello, world

Hello, world

Hello, world

See also

fontsize, small methods

blink method

Causes a string to blink as if it were in a <BLINK> tag.

语法stringName.blink()

stringName is any string or a property of an existing object.

用法

string

描述

Use the blink method with the write or writeln methods to format and display a string in a document.

例子The following example uses string methods to change the formatting of a string: var worldString="Hello, world"

document.write(worldString.blink())

document.write("<P>" + worldString.bold())

document.write("<P>" + worldString.italics())

document.write("<P>" + worldString.strike())

The previous example produces the same output as the following htm: Hello, world

Hello, world

Hello, world

Hello, world

See also

bold, italics, strike methods

blur method

Removes focus from the specified object.

语法1. passwordName.blur()

2. selectName.blur()

3. textName.blur()

4. textareaName.blur()

passwordName is either the value of the NAME attribute of a password object or an element in the elements array.

selectName is either the value of the NAME attribute of a select object or an element in the elements array.

textName is either the value of the NAME attribute of a text object or an element in the elements array.

textareaName is either the value of the NAME attribute of a textarea object or an element in the elements array.

用法

password, select, text, textarea

描述

Use the blur method to remove focus from a specific form element.

例子

The following example removes focus from the password element userPass: userPass.blur()

This example assumes that the password is defined as: <INPUT TYPE="password" NAME="userPass">

See also

focus, select methods

bold method

Causes a string to be displayed as bold as if it were in a <B> tag.

语法stringName.bold()

stringName is any string or a property of an existing object.

用法

string

描述

Use the bold method with the write or writeln methods to format and display a string in a document.

例子The following example uses string methods to change the formatting of a string: var worldString="Hello, world"

document.write(worldString.blink())

document.write("<P>" + worldString.bold())

document.write("<P>" + worldString.italics())

document.write("<P>" + worldString.strike())

The previous example produces the same output as the following htm: <BLINK>Hello, world</BLINK>

<P><B>Hello, world</B>

<P><I>Hello, world</I>

<P><STRIKE>Hello, world</STRIKE>

See also

blink, italics, strike methods

button object

A pushbutton on an htm form.

语法

To define a button: <INPUT

TYPE="button"

NAME="buttonName"

VALUE="buttonText"

[onClick="handlerText"]>

NAME="buttonName" specifies the name of the button object. You can access this value using the name property.

VALUE="buttonText" specifies the label to display on the button face. You can access this value using the value property.

To use a button object's properties and methods: 1. buttonName.propertyName

2. buttonName.methodName(parameters)

3. formName.elements[index].propertyName

4. formName.elements[index].methodName(parameters)

buttonName is the value of the NAME attribute of a button object.

formName is either the value of the NAME attribute of a form object or an element in the forms array.

index is an integer representing a button object on a form.

propertyName is one of the properties listed below.

methodName is one of the methods listed below.

Property of

form

描述

A button object on a form looks as follows:

A button object is a form element and must be defined within a <FORM> tag.

The button object is a custom button that you can use to perform an action you define. The button executes the script specified by its onClick event handler.

Properties

name reflects the NAME attribute

value reflects the VALUE attribute

Methods

click

Event handlers

onClick

例子

The following example creates a button named calcButton. The text "Calculate" is displayed on the face of the button. When the button is clicked, the function calcFunction() is called.

See also

form, reset, and submit objects

 
 
 
免责声明:本文为网络用户发布,其观点仅代表作者个人观点,与本站无关,本站仅提供信息存储服务。文中陈述内容未经本站证实,其真实性、完整性、及时性本站不作任何保证或承诺,请读者仅作参考,并请自行核实相关内容。
2023年上半年GDP全球前十五强
 百态   2023-10-24
美众议院议长启动对拜登的弹劾调查
 百态   2023-09-13
上海、济南、武汉等多地出现不明坠落物
 探索   2023-09-06
印度或要将国名改为“巴拉特”
 百态   2023-09-06
男子为女友送行,买票不登机被捕
 百态   2023-08-20
手机地震预警功能怎么开?
 干货   2023-08-06
女子4年卖2套房花700多万做美容:不但没变美脸,面部还出现变形
 百态   2023-08-04
住户一楼被水淹 还冲来8头猪
 百态   2023-07-31
女子体内爬出大量瓜子状活虫
 百态   2023-07-25
地球连续35年收到神秘规律性信号,网友:不要回答!
 探索   2023-07-21
全球镓价格本周大涨27%
 探索   2023-07-09
钱都流向了那些不缺钱的人,苦都留给了能吃苦的人
 探索   2023-07-02
倩女手游刀客魅者强控制(强混乱强眩晕强睡眠)和对应控制抗性的关系
 百态   2020-08-20
美国5月9日最新疫情:美国确诊人数突破131万
 百态   2020-05-09
荷兰政府宣布将集体辞职
 干货   2020-04-30
倩女幽魂手游师徒任务情义春秋猜成语答案逍遥观:鹏程万里
 干货   2019-11-12
倩女幽魂手游师徒任务情义春秋猜成语答案神机营:射石饮羽
 干货   2019-11-12
倩女幽魂手游师徒任务情义春秋猜成语答案昆仑山:拔刀相助
 干货   2019-11-12
倩女幽魂手游师徒任务情义春秋猜成语答案天工阁:鬼斧神工
 干货   2019-11-12
倩女幽魂手游师徒任务情义春秋猜成语答案丝路古道:单枪匹马
 干货   2019-11-12
倩女幽魂手游师徒任务情义春秋猜成语答案镇郊荒野:与虎谋皮
 干货   2019-11-12
倩女幽魂手游师徒任务情义春秋猜成语答案镇郊荒野:李代桃僵
 干货   2019-11-12
倩女幽魂手游师徒任务情义春秋猜成语答案镇郊荒野:指鹿为马
 干货   2019-11-12
倩女幽魂手游师徒任务情义春秋猜成语答案金陵:小鸟依人
 干货   2019-11-12
倩女幽魂手游师徒任务情义春秋猜成语答案金陵:千金买邻
 干货   2019-11-12
 
推荐阅读
 
 
 
>>返回首頁<<
 
靜靜地坐在廢墟上,四周的荒凉一望無際,忽然覺得,淒涼也很美
© 2005- 王朝網路 版權所有