javascript replace "<a>" globally code example Example: replace globally in javascript var str = str.replace(/ /g,'-');