var a = '<span class="test">33.3;34.55</span><img src="../../../test.gif" onclick=testThis(''open'')><span class="test">33.3;34.55</span><img src="../../../test.gif" onclick=testThis(''open'')>0.22';
Here, I need to replace dots in all parts of the string except in src and onclick. I have used two for loops to replace these tags and data with a placeholder. And replaced all dot with comma.
'<span class="test">33,3;34,55</span><img src=src_ph onclick=onclick_ph><span class="test">33,3;34,55</span><img src=src_ph onclick=onclick_ph>0,22';
But now I need those tags and data again. For this I have to make use of forloop again. Is there better solution? Thanks