Skip to content

Latest commit

 

History

History
18 lines (13 loc) · 265 Bytes

29_dom_css.md

File metadata and controls

18 lines (13 loc) · 265 Bytes

DOM CSS

改变 HTML 样式

document.getElementById(id).style.property=new style

例:

<p id="p2">Hello World!</p>
<script>
document.getElementById("p2").style.color="blue";
</script>

输出后Hello World!字体为蓝色