Specifies the length of the string code.

Source: Internet
Author: User

Specifies the length of the string code.

The following code intercepts a string of the specified length implemented by jQuery:
String truncation is a common operation. It can be said that it is very frequent. Almost any website with a news list will have this operation. The following is a code example that can implement this function, you can simply apply it, hoping to help you.
The Code is as follows:

 

<! DOCTYPE html> 

 

The above code can be used to intercept strings. The code is relatively simple and will not be described here.
Related reading:
1. For details about [limit], see [attribute] selector in jQuery.
2. For details about text (), see the text () method section of jQuery.
3. For details about the length attribute, see the length attribute section of the String object in JavaScript.
4. For details about the attr () function, refer to the attr () method section of jQuery.
5. For details about jQuery. fn, refer to the section about the role of jQuery. fn.

The original address is: http://www.softwhy.com/forum.php? Mod = viewthread & tid = 9529.

For more information, see: http://www.softwhy.com/jquery/

 

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.