August 1999
Intermediate to advanced
1488 pages
72h 53m
English
string.bold()
The bold() method will convert the string it is called on to an instance of the <bold> tag.
Listing 6.232 creates an instance of the String object and uses the document.write() method to write the tag to the page. The results of running this script will be the following:
<bold>Hello, World!</bold>
<script language="JavaScript"> <!–– Hide // Create an instance of the String object var myString = new String("Hello, World!"); // Write the string to the page after invoking the bold() method on it document.write(myString.bold()); // Close the stream to the window document.close(); ... |
Read now
Unlock full access