<span> iiiiiiiiiiiiiiiiiiyyyyyyyyy </span> <script> alert($("span").text().replace(/y/g, "i")); </script>