This is my jquery function the argument passed is php json_encoded data,
function html_modify(html) {
var str=JSON.stringify(html);
var arr=$.parseJSON(str);
var tot='';
$.each(arr,function(i,val){
if(i=='options') {
alert(val);
}
});
}
html_modify(<?php echo $encode ?>);
The value I will get on alert that is alert(val) will be,
<span style="font-family: Times New Roman; font-size: 12pt;"><img style="vertical-align:middle" width=83 height=44 src="image045.gif"></span><span style="font-family: Times New Roman; font-size: 12pt;"><img style="vertical-align:middle" width=48 height=44 src="image046.gif"></span><span style="font-family: Times New Roman; font-size: 12pt;"><img style="vertical-align:middle" width=48 height=44 src="image047.gif"></span><span style="font-family: Times New Roman; font-size: 12pt;"><img style="vertical-align:middle" width=83 height=44 src="image048.gif"></span>
I am trying to remove all the "spans" present in the result above and keep only "image" tags further. But currently have no clue. Thanks.