JavaScript fixed()Method
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
![]()
![]()
![]()
![]()
![]()
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>
var str = "Hello world!";
document.write(str.fixed());
</script>
Try it Yourself »
JavaScript String Object Other Extensions