Display only 10 characters of a long string?

前端 未结 12 2109
臣服心动
臣服心动 2020-12-13 01:19

How do I get a long text string (like a querystring) to display a maximum of 10 characters, using JQuery?

Sorry guys I\'m a novice at JavaScript & JQuery :S

12条回答
  •  谎友^
    谎友^ (楼主)
    2020-12-13 02:07

    What you should also do when you truncate the string to ten characters is add the actual html ellipses entity: , rather than three periods.

提交回复
热议问题