Style a certain character in a string

前端 未结 4 1338
名媛妹妹
名媛妹妹 2021-01-26 00:37

I want to style a certain character in a string via jQuery, but have no clue how to approach that. I have the following situation



        
4条回答
  •  既然无缘
    2021-01-26 01:17

    If it is just for this case, I would do it in the HTML rather than in JQuery:

    Link
    

    Note: The "text-decoration:none" is needed to remove the default underline for links, though you should probably set this in CSS.

    Here's a fiddle for that method.

    If you still want to do it with JQuery, you can just change the link style and inner html to the above.

提交回复
热议问题