String.prototype.ReplaceAll = stringReplaceAll; function stringReplaceAll(AFindText,ARepText){ raRegExp = new RegExp(AFindText,"ig"); return this.replace(raRegExp,ARepText) } function sb() { var s = document.getElementById("tt").value; s = s.ReplaceAll("and","wuyu_and_wuyu"); s = s.ReplaceAll("count","wuyu_count_wuyu"); s = s.ReplaceAll("or","wuyu_or_wuyu"); s = s.ReplaceAll("for","wuyu_for_wuyu"); }