Hi.
I have a few lines of code which I would like to be able to change. I can only do it client side, so I’m thinking a javaScript replace function might do the trick.
Basically, I have a code like this:
[code=html]<table border=”1″ cellpadding=”0″ class=”my_table”>
<tr>
<td>Text</td>
</tr>
</table>
I would like to change border=”1″ into border=”0″ – how do I do that?
I have played with this code:
[CODE]<script type=”text/javascript”>
function replace_stuff() {
document.body.innerHTML = document.body.innerHTML.replace(/border=”1″/g,’border=”0″‘);
}
</script>
but it doesn’t work in IE. (When replacing ordinary words with this script, it works fine in Firefox and IE…is it an escaping issue or should it be done in another way?)
Can anybody help me out?
Thanks.