jQuery text() with replace() doesn't replace the text

前端 未结 5 439
甜味超标
甜味超标 2021-01-19 19:45

I have the following H2:

Password reset instructions have been sent to *|RESETPASSWORDEMAIL|*

I

5条回答
  •  南方客
    南方客 (楼主)
    2021-01-19 20:11

    Use like that.

    $('#resetPWSuccess').text(
      $('#resetPWSuccess').text().replace('*|RESETPASSWORDEMAIL|*', 'neeraj@gmail.com')
    )
    

    See Demo Demo

提交回复
热议问题