Hi can someone convert this jquery in to plain javascript?
$("body *").each(function () {
$(this).html($(this).html().replace(/\[br\]/\g,'<br/>'));
});
What it does is, it finds all [br] and then replace it with <br/>
The code above works perfectly in chrome but not in mozilla and IE so i need to execute it in plain javascript. many thanks to all!
The problem was that you had an illegal character in your regular expression.
This works:
$(this).html($(this).html().replace(/\[br\]/g,'<br/>'));Live example: http://jsfiddle.net/tqksm/