I have the following H2:
Password reset instructions have been sent to *|RESETPASSWORDEMAIL|*
I
Use this instead :
$('#resetPWSuccess').text(
$('#resetPWSuccess').text().replace('*|RESETPASSWORDEMAIL|*', emailAddress)
).show();
Note that I also removed the h2
from your selector : it's useless and slower than just using the id. When you ask jQuery to search for #resetPWSuccess
, it uses the very fast native getElementById
function.
From jQuery's source code :
// Shortcuts
if ( (match = rquickExpr.exec( selector )) ) {
// Speed-up: Sizzle("#ID")
if ( (m = match[1]) ) {
if ( nodeType === 9 ) {
elem = context.getElementById( m );