How do I remove the first character from a link's text with jQuery?

前端 未结 4 1555
星月不相逢
星月不相逢 2021-01-04 03:46

I want to remove first character from link\'s text with jQuery.

 +123.23 
 -13.23          


        
4条回答
  •  陌清茗
    陌清茗 (楼主)
    2021-01-04 03:51

    $("span.test1, span.test2").each(function() {
      $(this).text($(this).text().replace(/[+-]/, ""));
    });
    

提交回复
热议问题