Substring text with HTML tags in Javascript

前端 未结 6 1343
小蘑菇
小蘑菇 2020-12-14 22:25

Do you have solution to substring text with HTML tags in Javascript?

For example:

var str = \'Lorem ipsum dolor sit         


        
6条回答
  •  陌清茗
    陌清茗 (楼主)
    2020-12-14 23:05

    Javascript has a sub-string method. It makes no difference if the string contains html.

    see http://www.w3schools.com/jsref/jsref_substr.asp

提交回复
热议问题