JavaScript: The Definitive Guide

Previous Chapter 21
JavaScript Reference
Next
 

String.link() Method

Name

String.link() Method---add a hypertext link to a string

Availability

Navigator 2.0, Internet Explorer 3.0

Synopsis

string.link(href)

Arguments

href

The URL target of the hypertext link that is to be added to the string. This string argument specifies the value of the HREF attribute of the <A> HTML tag.

Returns

A copy of string, enclosed within <A href="href"> and </A> HTML tags.

Example

The following two JavaScript fragments evaluate to identical strings:

'Section 1-1'.link('ch01#sect1')
'<A href="ch01#sect1">section 1-1</A>'

See Also

"String", "String.anchor()"


Previous Home Next
String.length Book Index String.prototype

HTML: The Definitive Guide CGI Programming JavaScript: The Definitive Guide Programming Perl WebMaster in a Nutshell
This HTML Help has been published using the chm2web software.