运行 ❯
获取您的
自有
网站
×
更改方向
保存代码
更改主题,深色/浅色
前往 Spaces
<!DOCTYPE html> <html> <body> <h1>Change font-size-adjust with JavaScript</h1> <p>Click the "Try it" button to adjust the font-size of the second DIV element with "0.545" (which is the aspect value of the Verdana font used in the first DIV element):</p> <button onclick="myFunction()">Try it</button> <div style="font-family:verdana;font-size:15px;"> <p>This is some text written in 15px Verdana.</p> </div> <div id="myDIV" style="font-family:times;font-size:15px;"> <p>This is some text written in 15px Times.</p> </div> <script> function myFunction() { document.getElementById("myDIV").style.fontSizeAdjust = "0.545"; } </script> </body> </html>