var my_str="Welcome to www.sharejs.com" var i=my_str.length; i=i-1; for (var x = i; x >=0; x--) { document.write(my_str.charAt(x)); }