My Code:
I tried the following code but the order of words are changing
var str = \"Welcome to my Website !\"; alert(str.split(\"\").reverse().join(
You can split on spaces, and then use map to reverse the letters in each word:
map
alert(str.split(" ").map(function(x) { return x.split("").reverse().join(""); }).join(" "));