I'm trying to make a javascript function that will find all the <td>
tags in a string and make them red. That way I can track down an errant tag who lacks his comanion </td>
. My problem is that when I copy the html of a page, it loses all of the indentation structure. Is there anyway to keep this structure?
$(document).ready(function(){
var html = $('body').html();
html.replace('<td>', '<td><span class="red">');
html.replace('</td>', '</td></span>');
$('#result').text(html);
});
Also, the string replacements don't seem to work at all. But one thing at a time.
Thanks for any ideas!