JSFiddle - React, Tailwind, and code Playground JavaScript var str = "ID: :ID:"; str = str.replace(":ID:", 0); console.log(str); alert(str);