当前位置: 首页 > 图文教程 > 网络编程 > Javascript > javascript手冊-i

Javascript
Dhtml:浏览大图时鼠标感应控制层滚动条的移动
初试javascript :贪吃蛇啊
只让输入数字的输入框
只能输入汉字的输入框
在JS中定义数组删除方法
在网页中使用realplayer播放rm文件
用层实现为网页中的图添加水印的效果
所见即所得编辑器 aynHTML 大全:(一)如何部署、嵌入、装载动态内容
JavaScript 收集的两个小代码!
JScript中正则表达函数的说明与应用
网页上内容导出到word里
关于开发在线网页编辑器按回车会输入<p>而不是<br>的解决方法
OOP In JS [JS脚本中的面向对象]
一个很通用的javascript的下拉菜单
将金额小写转化成汉字大写
VML Chart 控件
Js+Dhtml:WEB程序员简易开发工具包(预先体验版)
Javascript实例教程(21) OLE Automation(4)
javascript进行客户端数据的校验
JavaScript 小技巧(第三集)

Javascript 中的 javascript手冊-i


出处:互联网   整理: 软晨网(RuanChen.com)   发布: 2009-08-10   浏览: 59 ::
收藏到网摘: n/a

index property

An integer representing the index of an option in a select object.

语法

selectName.options[indexValue].index

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

Property of

options array

描述

The number identifying the position of the option in the selection, starting from zero.

相关

  • defaultSelected, selected, selectedIndex properties

    indexOf method

    Returns the index within the calling string object of the first occurrence of the specified value, starting the search at fromIndex.

    语法

    stringName.indexOf(searchValue, [fromIndex])

    stringName is any string or a property of an existing object.
    searchValue is a string or a property of an existing object, representing the value to search for.
    fromIndex is the location within the calling string to start the search from. It can be any integer from 0 to stringName.length - 1 or a property of an existing object.

    Method of

    string

    描述

    Characters in a string are indexed from left to right. The index of the first character is 0, and the index of the last character is stringName.length - 1.

    If you do not specify a value for fromIndex, JavaScript assumes 0 by default. If searchValue is not found, JavaScript returns -1.

    例子

    The following example uses indexOf and lastIndexOf to locate values in the string "Brave new world".
    var anyString="Brave new world"
    //Displays 8
    document.write("<P>The index of the first w from the beginning is " + anyString.indexOf("w"))
    //Displays 10
    document.write("<P>The index of the first w from the end is " + anyString.lastIndexOf("w"))
    //Displays 6
    document.write("<P>The index of 'new' from the beginning is " + anyString.indexOf("new"))
    //Displays 6
    document.write("<P>The index of 'new' from the end is " + anyString.lastIndexOf("new"))
    

    相关

  • charAt, lastIndexOf methods

    isNaN function

    On Unix platforms, evaluates an argument to determine if it is "NaN" (not a number).

    语法

    isNaN(testValue)

    testValue is the value you want to evaluate.

    描述

    The isNaN function is a built-in JavaScript function. It is not a method associated with any object, but is part of the language itself. isNaN is available on Unix platforms only.

    On all platforms except Windows, the parseFloat and parseInt functions return "NaN" when they evaluate a value that is not a number. The "NaN" value is not a number in any radix. You can call the isNaN function to determine if the result of parseFloat or parseInt is "NaN". If "NaN" is passed on to arithmetic operations, the operation results will also be "NaN".

    The isNaN function returns true or false.

    例子

    The following example evaluates floatValue to determine if it is a number, then calls a procedure accordingly.

    floatValue=parseFloat(toFloat)
    if isNaN(floatValue) { notFloat()
    } else { isFloat()
    }
    

    相关

  • parseFloat, parseInt functions

    italics method

    Causes a string to be italicized as if it were in an <I> tag.

    语法

    stringName.italics()

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

    Method of

    string

    描述

    Use the italics 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>
    

    相关

  • blink, bold, strike methods