编辑下面的代码:【加编码】
<html> <head> <script> function displayResult() { document.getElementById("div1").style.lineHeight="2"; } </script> </head> <body> <div id="div1"> This is some text. This is some text. This is some text. This is some text. This is some text. This is some text. This is some text. This is some text. This is some text. This is some text. This is some text. This is some text. </div> <br> <button type="button" onclick="displayResult()">Change line height</button> </body> </html>
结果: 【此窗口】 帮助?
Try it Yourself - © 自强学堂