I'm trying to figure out how I replaces/removes parts of text in string in realtime using jQuery.

This is what i got now:
PHP Code:
$str 'This is a <b>test</b>. Its not going well!';

echo 
'<div class="element">';
echo 
'<span>'.$str.'</span>';
echo 
'</div>';

echo 
'<p>Remove</p>'
Code JavaScript:
$('p').click(function() {
	$('.element span').each(function() {
		var test = array('<b>','</b>','well');
		//var test = 'not';
        console.log($(this).text());
        var text = $(this).text().replace(test, '');
        $(this).text(text);
    });
});

The problem: As above nothing happens. If I use the var test = 'not'; instead of the array part it works except it also removes the <b> tags?

How do I get the array part to work and why is it removing htmltags when executed?

Thanks in advance ;-)