久久久久久久视色,久久电影免费精品,中文亚洲欧美乱码在线观看,在线免费播放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改變背景的方法:首先獲取元素對象;然后使用style對象的background屬性來改變背景,語法“元素對象.style.background="顏色值|圖片地址"”。

      javascript如何改變背景

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

      <!DOCTYPE html> <html> <head>     <meta charset="UTF-8">     <title>document</title>     <script type="text/javascript">     function bs(v) {         kuang.style.background=v;             }     </script> </head>   <body>     <p>請選擇顏色:</p>     <select id="test" name="xuanzekuang" onchange="bs(this.value)">         <option value="red">紅</option>         <option value="green">綠</option>         <option value="blue">藍</option>         <option value="black">黑</option>     </select>     <div id="kuang" style="width: 100px;height: 100px;border: 1px solid #eee">     </div> </body> </html>

      效果:

      javascript如何改變背景

      說明:Style background 屬性

      background 屬性以速記形式設置或返回最多五個獨立的背景屬性。

      通過該屬性,您可以設置/返回:

      • background-color

      • background-image

      • background-repeat

      • background-attachment

      • background-position

      上述的屬性,也可以設置單獨的樣式屬性。強烈建議使用單獨的屬性這樣有更好的可控性。

      語法:

      1、設置 background 屬性:

      Object.style.background="color image repeat attachment position"

      2、返回 background 屬性:

      Object.style.background

      javascript如何改變背景

      【推薦學習:javascript高級教程】

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