87,910
社区成员
发帖
与我相关
我的任务
分享
<textarea cols="50" rows="1" style="width:300px;background:gray" disabled="disabled" id="content"></textarea>
<div class="item">
<label>类型:</label>
<input type="radio" name="type" value="click" onclick="changeRadio()"/>
<pre>事件</pre>
<input type="radio" name="type" value="view" onclick="changeRadio()"/>
<pre>跳转</pre>
</div>
//点击radio,改变textarea的style属性,怎么写?比如把background:gray改成background:black
<textarea cols="50" rows="1" style="width:300px;background:gray" disabled="disabled" id="content"></textarea>
<div class="item">
<label>类型:</label>
<input type="radio" name="type" value="click" onclick="changeRadio('black')"/>
<pre>事件</pre>
<input type="radio" name="type" value="view" onclick="changeRadio('gray')"/>
<pre>跳转</pre>
</div>
<script type="text/javascript">
function changeRadio(bgc) {
document.getElementById("content").style.backgroundColor = bgc;
}
</script>