Method | NS2 | NS3 | NS4 | NS6 | IE3a | IE3b | IE4 | IE5 | IE5.5 | IE6 |
anchor | x | x | x | x | x | x | x | x | x | x |
| Returns: String |
| This method returns a string with an HTML anchor with a NAME attribute around specified text in the object. |
| Syntax: string .anchor( text ) , where text is the text you want to place in the NAME attribute of the HTML anchor. |
big | x | x | x | x | x | x | x | x | x | x |
| Returns: String |
| This method changes the text to big text by surrounding it with HTML <BIG> tags. |
| Syntax: string .big() . See "Formatting Text" in this chapter. |
blink | x | x | x | x | x | x | x | x | x | x |
| This method changes the text to blinking text by surrounding it with HTML <BLINK> tags. |
| Syntax: string .blink() . See "Formatting Text" in this chapter. |
bold | x | x | x | x | x | x | x | x | x | x |
| This method changes the text to big text by surrounding it with HTML <B> tags. |
| Syntax: string .bold() . See "Formatting Text" in this chapter. |
charAt | x | x | x | x | x | x | x | x | x | x |
| Returns: Single character |
| This method returns the character at the specified index of a String object. |
| Syntax: string .charAt( index ) , where index is the index of the character you want. |
charCodeAt | | | x | x | | | x | x | x | x |
| Returns: Integer character code |
| This method returns the character code of the character at the specified index of a String object. |
| Syntax: string .charCodeAt( index ) , where index is the index of the character whose code you want. |
concat | | | x | x | | | x | x | x | x |
| Returns: String |
| Returns a string value containing the concatenation of the current string with any given string(s). Sytnax: string .concat([ string1 [, ... [, stringN ]]]]) . |
fixed | x | x | x | x | x | x | x | x | x | x |
| This method changes the text to fixed-width text by surrounding it with HTML <TT> tags. |
| Syntax: string .fixed() . See "Formatting Text" in this chapter. |
fontcolor | x | x | x | x | x | x | x | x | x | x |
| This method sets font color by adding <FONT> tags. |
| Syntax: string .fontcolor( color ) , where color is the new color (either a color triplet or a color name recognized by the browser). |
fontsize | x | x | x | x | x | x | x | x | x | x |
| This method sets font size by adding <FONT> tags. |
| Syntax: string .fontsize( size ) , where size is the an integer for the <FONT> tag's SIZE attribute. |
fromCharCode | | | x | x | | | x | x | x | x |
| Returns: String |
| This method returns a string from a number of character values. |
| Syntax: string .fromCharCode([ code1 [, ... [, codeN ]]]]). |
indexOf | x | x | x | x | x | x | x | x | x | x |
| Returns: Integer |
| This method the character position where the first occurrence of a substring occurs within a String object. |
| Syntax: string .indexOf( subString ), where subString is the string you're searching for. See "Searching Strings" in this chapter. |
italics | x | x | x | x | x | x | x | x | x | x |
| This method changes the text to italics by surrounding it with HTML <I> tags. |
| Syntax: string .italics() . See "Formatting Text" in this chapter. |
lastIndexOf | x | x | x | x | x | x | x | x | x | x |
| Returns: Integer |
| This method the character position where the last occurrence of a substring occurs within a String object. |
| Syntax: string .lastIndexOf( subString ), where subString is the string for which you're searching. See "Searching Strings" in this chapter. |
link | x | x | x | x | x | x | x | x | x | x |
| This method returns as string with an HTML anchor and an HREF attribute around the text in a String object. |
| Syntax: string .link( href ) , where href is the URL the hyperlink should point to. |
localeCompare | | | | x | | | | | x | x |
| Returns: Integer |
| This method performs a locale-sensitive string comparison of strings. |
| Returns -1, 0, or +1, depending on the sort order of the system default locale. |
| Syntax: string1 .localeCompare( string2 ) . If string1 sorts before string2 , returns -1; if string1 sorts after string2 , returns 1. Returning 0 means that the two strings are equal. |
match | x | x | x | x | x | x | x | x | x | x |
| Returns: Array of strings |
| This method executes a regular expression match on the string. |
| Syntax: string .match( regExp ) . Returns an array of matches or null if there were no matches. See Chapter 20 for more on regular expressions. |
replace | | | x | x | | | x | x | x | x |
| Returns: New string |
| This method replaces substrings with a new string. |
| Syntax: string.replace( regExp , replacementText ) , where regExp is a regular expression and replacementText replaces matches to regExp (all matches are replaced if regExp includes the /g modifier). See "Searching and Replacing" in this chapter for an example. |
search | | | x | x | | | x | x | x | x |
| Returns: Integer |
| This method returns the position of the first substring match in a regular expression search. |
| Syntax: string .search( regExp ) , where regExp is the regular expression to match. |
slice | | | x | x | | | x | x | x | x |
| Returns: String |
| This method returns a slicethat is, a sectionof a string. |
| Syntax: string .slice( start , end ) , where start and end are the indices of the start and end points of the slice. |
small | x | x | x | x | x | x | x | x | x | x |
| This method changes the text to small text by surrounding it HTML <SMALL> tags. |
| Syntax: string .small() . See "Formatting Text" in this chapter. |
split | | x | x | x | | | x | x | x | x |
| Returns: Array of strings |
| This method splits a string. Returns the array of strings that results when a string is separated into substrings. |
| Syntax: string .split( separator [, max ]) , where separator is the delimiter (such as "," ) or regular expression to split into substrings, and max is the maximum number of substrings to create. See "Splitting Strings" in this chapter. |
strike | x | x | x | x | x | x | x | x | x | x |
| This method changes the text to struck-out text by surrounding it with HTML <STRIKE> tags. |
| Syntax: string .strike() . See "Formatting Text" in this chapter. |
sub | x | x | x | x | x | x | x | x | x | x |
| This method changes the text to subscript text by surrounding it with HTML <SUB> tags. |
| Syntax: string .sub() . See "Formatting Text" in this chapter. |
substr | | | x | x | | | x | x | x | x |
| Returns: String |
| This method returns a substring beginning at a specified location and having a given length. |
| Syntax: string .substr( start [, length ) ; where start is the beginning index of the substring, and length is the length of the substring. |
substring | x | x | x | x | x | x | x | x | x | x |
| Returns: String |
| This method returns the substring at the specified location within a String object. |
| Syntax: string .substring( start [, end ) ; where start is the beginning index of the substring, and end is the ending index of the substring. |
sup | x | x | x | x | x | x | x | x | x | x |
| This method changes the text to superscript text by surrounding it with HTML <SUP> tags. |
| Syntax: string .sup() . See "Formatting Text" in this chapter. |
toLocaleLowerCase | | | | x | | | | | x | x |
| Returns: String |
| This method converts the string to locale-sensitive lower case. |
| Syntax: string .toLocaleLowerCase() . |
toLocaleUpperCase | | | | x | | | | | x | x |
| Returns: String |
| This method converts the string to locale-sensitive upper case. |
| Syntax: string .toLocaleUpperCase() . |
toLowerCase | x | x | x | x | x | x | x | x | x | x |
| Returns: String |
| This method converts the string to lower case. |
| Syntax: string .toLowerCase() . See "Changing Case" in this chapter. |
toString | | | x | x | | | x | x | x | x |
| Returns: String |
| This method just returns the string itself. |
| Syntax: string .toString() . |
toUpperCase | x | x | x | x | x | x | x | x | x | x |
| Returns: String |
| This method converts the string to upper case. |
| Syntax: string .toUpperCase() . See "Changing Case" in this chapter. |
valueOf | | | x | x | | | x | x | x | x |
| Returns: String |
| This method just returns the string itself. |
| Syntax: string .valueOf() . |