您的位置:首页 > Web前端 > CSS

<Js>修改样式

2016-05-31 19:06 399 查看
document.getElementById("ao"+"\n").style.color="green";

document.getElementById("ao"+"\n").style.fontsize="50px";

document.getElementById("ao"+"\n").style.width="20px";


点击修改:
<h1 id="ao">什么?</h1>
<input type="button" value="请点击" onclock="document.getElementById("ao").style.width="20px""  />


隐藏和显示:
<input type="button" value="隐藏文本" onclick="document.getElementById('p1').style.visibility='hidden'" />
<input type="button" value="显示文本" onclick="document.getElementById('p1').style.visibility='visible'" />
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: