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

.removeProp()

.removeProp( propertyName, value ) 返回: jQuery

描述: 為匹配的元素刪除設(shè)置的屬性。

  • version added: 1.6.removeProp( propertyName, value )

    propertyName要設(shè)置屬性的名稱(chēng).

    value要設(shè)置屬性的值

.removeProp()方法用來(lái)刪除由.prop()方法設(shè)置的屬性集。

隨著一些內(nèi)置屬性的DOM元素或window對(duì)象,如果試圖將刪除該屬性,瀏覽器可能會(huì)產(chǎn)生錯(cuò)誤。jQuery第一次分配undefined值的屬性,而忽略了瀏覽器生成的任何錯(cuò)誤。

其他注意事項(xiàng):

  • 在Internet Explorer之前的版本9,使用.prop()設(shè)置DOM元素的屬性值以外的任何一個(gè)簡(jiǎn)單的原始(數(shù)字,字符串或布爾)如果DOM元素之前從文檔中不刪除該屬性(使用.removeProp()),可能導(dǎo)致內(nèi)存泄漏。為了安全地設(shè)置對(duì)象無(wú)泄漏內(nèi)存值對(duì)DOM,使用.data()

Example:

設(shè)置一個(gè)段落數(shù)字屬性,然后將其刪除。

<!DOCTYPE html>
<html>
<head>
  <style>
  img { padding:10px; }
  div { color:red; font-size:24px; }
</style>
  <script src="http://code.jquery.com/jquery-git.js"></script>
</head>
<body>
  
  <p></p>


<script>
var $para = $("p");
$para.prop("luggageCode", 1234);
$para.append("The secret luggage code is: ", String($para.prop("luggageCode")), ". ");
$para.removeProp("luggageCode");
$para.append("Now the secret luggage code is: ", String($para.prop("luggageCode")), ". ");

</script>

</body>
</html>

Demo:

jQuery 1.6 API 中文版腳本之家整理、修訂 (2011年6月)
伊川县| 泰州市| 兴和县| 盐山县| 丰宁| 桂林市| 秦安县| 嵊州市| 利辛县| 雅江县| 九龙县| 都安| 正蓝旗| 滨海县| 右玉县| 怀柔区| 香港 | 固安县| 鄂托克前旗| 琼海市| 濮阳市| 松阳县| 闽清县| 彰武县| 安平县| 涪陵区| 浙江省| 杂多县| 海南省| 东宁县| 墨竹工卡县| 富顺县| 绥芬河市| 新沂市| 同德县| 襄樊市| 文安县| 峨眉山市| 南安市| 乐都县| 松溪县|