Ask Ben: Javascript String Replace Method
alert(
"Value Count: "
+ CountValue( strText, new RegExp(
"th"
,
"gi"
) ) );
For Cut-and-Paste
alert( "Value Count: " + CountValue( strText, new RegExp( "th", "gi" ) ) );