How do we mutate a string in Javascript
I have a string t2 and I want to mutate this string based on the below if
condition . I tried .replace but it doesnt work.
t2 = "<li
class='coded_true'>"+tp_info.elements["info"].cdatas.join.strip+"</li>"
if (tp_info.attributes["ITcoded"]== "true")
t2= t2.replace(t2,"<li class='coded_true
ITcoded_true'>"+tp_info.elements["info"].cdatas.join.strip+"</li>");
end
Thanks!
No comments:
Post a Comment