functionReplaceAll(str,sptr,sptr1) { while(str.indexOf(sptr)>=0) { str=str.replace(sptr,sptr1); } //returnstr; alert(str); }