Syntax analysis of JavaScript fixed () method

Source: Internet
Author: User

The JavaScript fixed () method has many things worth learning. Here we will share with you the definition and syntax of it. I believe this article will surely help you gain some benefits.

JavaScript fixed () method

Definition and usage

The fixed () method is used to display strings as typewriter fonts.

Syntax

StringObject. fixed () instance

In this example, "Hello world! "Will be displayed as typewriter text:

 
 
  1. <script type="text/javascript"> 
  2.  
  3. var str="Hello world!" 
  4. document.write(str.fixed())  
  5.  
  6. </script> 

JavaScript fixed function syntax

String. fixed ();

JavaScript fixed function return value

Returns the bold string defined using the HTML tt tag.

JavaScript fixed function example

 
 
  1. var str = "www.51cto.com";  
  2.  
  3. document.write(str.fixed());  
  4.  

Result:

 
 
  1. www.51cto.com  
  2.  

The single-cell distance string defined using the HTML tt tag.
 

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.