setAttribute() メソッドは、要素の属性を設定するメソッド。
element.setAttribute('attribute', 'value')
のように使う。
<form>
<select onChange="document.body.setAttribute('bgColor', this.options[this.selectedIndex].value);">
<option value="white">white
<option value="red">red
<option value="blue">blue
<option value="yellow">yellow
<option value="green">green
</select>
</form>