<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'" />