How to replace HTML?

I’dd like to replace some HTML code (stored in a dataprovider).

Change the HTML background color, for example…

This is the method I try to use, but without succes; the method does not replace anything…

var color = application.showColorChooser()
if(color)
{
utils.stringReplace(forms.my_htmlfield, 'body bgcolor="#ffffff"' , 'body bgcolor="' + color + '"');
}

you have to put it in somewhere:

var a = forms.my_htmlfield
var color = application.showColorChooser() 
if(color) 
{ 
var b  = utils.stringReplace(a, 'body bgcolor="#ffffff"' , 'body bgcolor="' + color + '"'); 
}