使用JavaScriptfixed()方法以固定间距字体显示字体,就像在<tt>标记中一样。
您可以尝试运行以下代码以固定间距字体显示字符串。
<html>
<head>
<title>JavaScript String fixed() Method</title>
</head>
<body>
<script>
var str = new String("Hello world");
alert(str.fixed());
</script>
</body>
</html>