Here is the html that is used to embed the above molecule:
<object id="molview1" type="chemical/x-xyz" width="400" height="300" >
<param name="caption" value="water"/>
<param name="skyground" value="false"/>
<param name="bgcolour" value="green"/>
<param name="inline" value="3

Water

O 4.013 0.831 -9.083

H 4.941 0.844 -8.837

H 3.750 -0.068 -9.293

"/>
</object>
Click on the buttons to change the background colour:
Here is the html and javascript used to implement the buttons:
<script type="text/javascript">
function button_bgcolour(new_colour)
{
var molview1 = document.getElementById('molview1');
molview1.bgcolor = new_colour;
}
</script>
<form>
<input type="button" value="red" onclick='button_bgcolour(this.value)' />
<input type="button" value="aqua" onclick='button_bgcolour(this.value)' />
<input type="button" value="#F0F0F0" onclick='button_bgcolour(this.value)' />
</form>