最新国产好看的视频,伊人天堂AV在线,国产Aaaaaa视频,蜜臀视频在线观看一区,人妻av色图,密臀久久久精品影片,青青视频免费观看毛片,久草在线观看视,国产三级精品色情在线

jQuery中removeProp()方法用法實(shí)例

 更新時(shí)間:2015年01月05日 10:48:32   投稿:shichen2014  
這篇文章主要介紹了jQuery中removeProp()方法用法,實(shí)例分析了removeProp()方法的功能、定義及刪除由prop()方法設(shè)置的屬性時(shí)的使用技巧,需要的朋友可以參考下

本文實(shí)例講述了jQuery中removeProp()方法用法。分享給大家供大家參考。具體分析如下:

此方法可以刪除由prop()方法設(shè)置的屬性。

語(yǔ)法:

復(fù)制代碼 代碼如下:
$("selector").removeProp(name)

參數(shù)列表:

參數(shù) 描述
name 定義要要?jiǎng)h除的屬性名稱。

實(shí)例:

實(shí)例一:

復(fù)制代碼 代碼如下:

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta name="author" content="http://www.fzitv.net/" />
<head>
<title>腳本之家</title>
<script type="text/javascript" src="mytest/jQuery/jquery-1.8.3.js"></script>
<script type="text/javascript">
    $(document).ready(function(){
       $("td").prop({width:"200",height:"300"});
       $("button").click(function(){
           $("td").removeProp("width");
       })
    })
</script>
</head>
<body>
    <table border="1">
      <tr>
       <td>歡迎來(lái)到腳本之家</td>
      </tr>
    </table>
    <button>刪除屬性</button>
</body>
</html>

以上代碼可以刪除td的width屬性。

實(shí)例二:

復(fù)制代碼 代碼如下:

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta name="author" content="http://www.fzitv.net/" />
<head>
<title>腳本之家</title>
<style type="text/css">
   td
   {
       width:200px;
   }
</style>
<script type="text/javascript" src="mytest/jQuery/jquery-1.8.3.js"></script>
<script type="text/javascript">
    $(document).ready(function(){
       $("td").prop({height:"300"});
       $("button").click(function(){
            $("td").removeProp("width");
       })
    })
</script>
</head>
<body>
    <table border="1">
      <tr>
       <td>歡迎來(lái)到腳本之家</td>
      </tr>
    </table>
    <button>刪除屬性</button>
</body>
</html>

以上代碼并沒(méi)有刪除td的width屬性,這是因?yàn)閞emoveProp()只能刪除由prop()方法設(shè)置的屬性。

希望本文所述對(duì)大家的jQuery程序設(shè)計(jì)有所幫助。

相關(guān)文章

最新評(píng)論

十堰市| 庆云县| 旅游| 峨山| 宜城市| 耒阳市| 桂东县| 特克斯县| 康马县| 甘孜| 桦甸市| 阿瓦提县| 思南县| 徐水县| 德保县| 威信县| 平利县| 丘北县| 犍为县| 乌兰察布市| 黑龙江省| 岳池县| 金沙县| 青川县| 湖口县| 祁门县| 元朗区| 晴隆县| 金山区| 桐柏县| 林芝县| 汝南县| 类乌齐县| 蒙山县| 青铜峡市| 宾阳县| 合作市| 滨州市| 九寨沟县| 霸州市| 泌阳县|