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