久久久久久久视色,久久电影免费精品,中文亚洲欧美乱码在线观看,在线免费播放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)站

      jquery怎么修改type屬性

      在jquery中,可以利用attr()方法來修改元素的type屬性,該方法可以設(shè)置被選元素的屬性值,語法為“$(selector).attr("type","新值")”或“$(selector).attr({type:新值})”。

      jquery怎么修改type屬性

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

      在jquery中,通過取得input對象,使用attr()方法可以改變type類型 。語法:

      $(selector).attr("type","新值"); $(selector).attr({type:新值});

      示例:

      在p標(biāo)簽內(nèi),使用input標(biāo)簽創(chuàng)建一個(gè)輸入框,并設(shè)置其value默認(rèn)值為abcdefg。

      jquery怎么修改type屬性

      在test.html文件內(nèi),設(shè)置input標(biāo)簽的id屬性值為tuinput,主要用于下面通過此id獲得input對象。

      jquery怎么修改type屬性

      在test.html文件內(nèi),使用button標(biāo)簽創(chuàng)建一個(gè)按鈕,按鈕名稱為“改變input的type屬性”。

      jquery怎么修改type屬性

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

      jquery怎么修改type屬性

      在js標(biāo)簽中,創(chuàng)建editype()函數(shù),在函數(shù)內(nèi),通過id(tuinput)獲得input對象,使用attr()方法改變type屬性值為password。

      jquery怎么修改type屬性

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

      jquery怎么修改type屬性

      jquery怎么修改type屬性

      【推薦學(xué)習(xí):jQuery視頻教程、web前端視頻】

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