How to change only text node in element

前端 未结 8 827
不知归路
不知归路 2020-11-28 10:40

I have next html:


And I want to chang

8条回答
  •  佛祖请我去吃肉
    2020-11-28 10:48

    It may not be the prettiest way, but this works:

    var $label = $('label[for=user_name]');
    $label.html($label.html().replace("Name", "Title"));
    

提交回复
热议问题