久久久久久久视色,久久电影免费精品,中文亚洲欧美乱码在线观看,在线免费播放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. 站長(zhǎng)資訊網(wǎng)
      最全最豐富的資訊網(wǎng)站

      html5怎樣設(shè)置button按鈕跳轉(zhuǎn)頁面

      方法:1、利用“<button onclick="window.location.href=跳轉(zhuǎn)地址">”語句設(shè)置;2、利用“<a href=跳轉(zhuǎn)地址><button>按鈕</button></a>”語句用a標(biāo)簽包裹button元素設(shè)置。

      html5怎樣設(shè)置button按鈕跳轉(zhuǎn)頁面

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

      html5怎樣設(shè)置button按鈕跳轉(zhuǎn)頁面

      1、利用onclick點(diǎn)擊事件和window.location.href屬性給按鈕元素添加點(diǎn)擊事件進(jìn)行跳轉(zhuǎn)頁面。

      語法如下:

      <button onclick="window.location.href=跳轉(zhuǎn)地址">按鈕</button>

      示例如下:

      <!DOCTYPE html> <html lang="en"> <head>     <meta charset="UTF-8">     <meta name="viewport" content="width=device-width, initial-scale=1.0">     <meta http-equiv="X-UA-Compatible" content="ie=edge">     <title>Document</title> </head> <body> <button onclick="window.location.href='https://www.baidu.com/'">按鈕</button> </body> </html>

      輸出結(jié)果:

      html5怎樣設(shè)置button按鈕跳轉(zhuǎn)頁面

      2、利用a標(biāo)簽將button元素包裹起來,利用a標(biāo)簽的href屬性設(shè)置跳轉(zhuǎn)地址即可。

      示例如下:

      <!DOCTYPE html> <html lang="en"> <head>     <meta charset="UTF-8">     <meta name="viewport" content="width=device-width, initial-scale=1.0">     <meta http-equiv="X-UA-Compatible" content="ie=edge">     <title>Document</title> </head> <body> <a href="https://www.baidu.com/"><button>按鈕</button></a> </body> </html>

      輸出結(jié)果與上述結(jié)果相同。

      推薦教程:《html視頻教程》

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