I have the following H2:
<h2 id="resetPWSuccess">Password reset instructions have been sent to *|RESETPASSWORDEMAIL|*</h2>
I want to replace the *|RESETPASSWORDEMAIL|*
with current email address that I have in the jQuery variable emailAddress
.
I have tried the following but it doesn't work:
$('h2#resetPWSuccess').text().replace('*|RESETPASSWORDEMAIL|*', emailAddress).show();
Is there a way to update the h2 text - I prefer one line if possible.
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…