久久久久久久视色,久久电影免费精品,中文亚洲欧美乱码在线观看,在线免费播放AV片

<center id="vfaef"><input id="vfaef"><table id="vfaef"></table></input></center>

    <p id="vfaef"><kbd id="vfaef"></kbd></p>

    
    
    <pre id="vfaef"><u id="vfaef"></u></pre>

      <thead id="vfaef"><input id="vfaef"></input></thead>

    1. 站長資訊網(wǎng)
      最全最豐富的資訊網(wǎng)站

      javascript如何加粗

      javascript實現(xiàn)加粗的方法:1、使用p標簽創(chuàng)建一行文字;2、通過指定id獲得input對象;3、使用button標簽創(chuàng)建一個按鈕;4、通過執(zhí)行addbold函數(shù)實現(xiàn)文本加粗即可。

      javascript如何加粗

      本文操作環(huán)境:windows7系統(tǒng)、javascript1.8.5版、Dell G3電腦。

      javascript如何加粗?

      js控制文本加粗:

      新建一個html文件,命名為test.html,用于講解js中怎么控制文本加粗。

      javascript如何加粗

      在test.html文件內(nèi),使用p標簽創(chuàng)建一行文字,文字內(nèi)容為“這是測試的文字”。

      javascript如何加粗

      在test.html文件內(nèi),設(shè)置p標簽的id為myid,主要用于下面通過該id獲得input對象。

      javascript如何加粗

      在test.html文件內(nèi),使用button標簽創(chuàng)建一個按鈕,按鈕名稱為“文本加粗”。

      javascript如何加粗

      在test.html文件中,給button按鈕綁定onclick點擊事件,當按鈕被點擊時,執(zhí)行addbold()函數(shù)。

      javascript如何加粗

      在js標簽中,創(chuàng)建addbold()函數(shù),在函數(shù)內(nèi),使用getElementById()方法通過id(myid)獲得p標簽對象,設(shè)置其style下的fontWeight屬性值為bolder,從而實現(xiàn)文本加粗。

      javascript如何加粗

      在瀏覽器打開test.html文件,點擊按鈕,查看實現(xiàn)的效果。

      javascript如何加粗

      推薦學習:《javascript基礎(chǔ)教程》

      贊(0)
      分享到: 更多 (0)
      網(wǎng)站地圖   滬ICP備18035694號-2    滬公網(wǎng)安備31011702889846號