Style a certain character in a string

前端 未结 4 1308
名媛妹妹
名媛妹妹 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条回答
  •  旧时难觅i
    2021-01-26 01:05

    I replaced the "i" with a span dynamically:

    var jq = $('a');
    var text = jq.text().replace(jq.attr('accessKey'), 'i');
    jq.html(text);
    

    http://jsfiddle.net/FishBasketGordo/QGEzA/

提交回复
热议问题