Ask Ben: Javascript String Replace Method
alert( strText.replace(
"th"
,
"[X]"
) );
For Cut-and-Paste
alert( strText.replace( "th", "[X]" ) );