javascript replace special characters with ascii code example Example: js remove special characters var desired = stringToReplace.replace(/[^\w\s]/gi, '')