這篇文章主要介紹了JavaScript中fixed()方法的使用,是JS入門學習中的基礎知識,需要的朋友可以參考下
此方法會導致就好像它是在一個的標簽被顯示在固定間距的字體的字符串。
語法
- string.fixed( )
下面是參數的詳細信息:
NA
返回值:
返回字符串的標簽
例子:
- <html>
- <head>
- <title>JavaScript String fixed() Method</title>
- </head>
- <body>
- <script type="text/javascript">
- var str = new String("Hello world");
- alert(str.fixed());
- </script>
- </body>
- </html>
這將產生以下結果:
- <tt>Hello world</tt>
|
新聞熱點
疑難解答
圖片精選