JavaScript fixed()Method

String 对象参考手册JavaScript String Object

Definition and Usage

The fixed() method is used to display a string in typewriter font.

This method returns the string wrapped in a <tt> tag, as follows:

<tt>string</tt>

Syntax

string.fixed()


Browser Support

Internet ExplorerFirefoxOperaGoogle ChromeSafari

All major browsers support the fixed() method.


Examples

Examples

Display a string as typewriter text:

<script>

var str = "Hello world!";
document.write(str.fixed());

</script>

Try it Yourself »


String 对象参考手册JavaScript String Object Other Extensions