I have got a variable with a table:
var tableCode='<table><tr><td><span class'thisone'>'the_text_to_change'</span><span class'thisone'>'other_text_to_change'</span><span class'thisone'>'another_text_to_change'</span></td></tr></table>'
I would want to replace the text inside each span with the class 'thisone', each one depending on the value inside of the class.
So the variable tableCode should be:
var tableCode='<table><tr><td><span class'thisone'>'the_text_changed_1'</span><span class'thisone'>'the_text_changed_2'</span><span class'thisone'>'the_text_changed_3'</span></td></tr></table>'
I have been reading the documentation of each: https://api.jquery.com/each/, but it is for the DOM and not for a variable in Javascript.
So: Read the variable, go throw it and detect the spans with a specific css class and change the value depending on the text.
Thank you very much!!!