Use the JavaScript fixed() method to display in fixed-pitch font as if it were in a <tt> tag.
Example
You can try to run the following code to display a string in the fixed-pitch font.
<html> <head> <title>JavaScript String fixed() Method</title> </head> <body> <script> var str = new String("Hello world"); alert(str.fixed()); </script> </body> </html>