简单教程
提交运行
代码编辑器:
<script> function displayResult(){ document.getElementById("p1").style.fontVariant="small-caps"; } </script> <p id="p1">This is some text.</p> <p>THIS IS SOME TEXT.</p> <br> <button type="button" onclick="displayResult()">修改字体</button>
运行结果: