Monday, May 20, 2024
 Popular · Latest · Hot · Upcoming
112
rated 0 times [  119] [ 7]  / answers: 1 / hits: 23323  / 12 Years ago, sun, november 25, 2012, 12:00:00

This is a simple replace() question - and I can't get it working to replace a substring in the function below.



function linkOnClick(){
var anyNameYouLike = 'some sort of text/string right here';
anyNameYouLike.replace('right','in');
alert(anyNameYouLike)
}


It should return some sort of text/string in here but doesn't. What am I doing wrong? I'm fairly new with Javascript (if it isn't obvious...)


More From » replace

 Answers
29
anyNameYouLike = anyNameYouLike.replace('right','in');

[#81816] Friday, November 23, 2012, 12 Years  [reply] [flag answer]
Only authorized users can answer the question. Please sign in first, or register a free account.
jamila

Total Points: 490
Total Questions: 94
Total Answers: 94

Location: Lebanon
Member since Sun, Aug 2, 2020
4 Years ago
;