August 1999
Intermediate to advanced
1488 pages
72h 53m
English
string.strike()
The strike() method will convert the string it is called on to an instance of the <strike> tag.
Listing 6.252 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:
<strike>Hello, World!</strike>
<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 strike() method on it document.write(myString.strike()); // Close the stream to ... |
Read now
Unlock full access