欧美bbbwbbbw肥妇,免费乱码人妻系列日韩,一级黄片

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

 更新時(shí)間:2015年01月05日 10:13:32   投稿:shichen2014  
這篇文章主要介紹了jQuery中removeAttr()方法用法,實(shí)例分析了removeAttr()方法的功能、定義及從匹配元素中移除相應(yīng)屬性的使用技巧,需要的朋友可以參考下

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

此方法從匹配元素中移除相應(yīng)的屬性。

語(yǔ)法結(jié)構(gòu):

復(fù)制代碼 代碼如下:
$(selector).removeAttr(attribute)

參數(shù)列表:

參數(shù) 描述
attribute 定義要從匹配元素中移除的屬性

實(shí)例代碼:

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

<!DOCTYPE html>
<html>
<head>
<meta charset=" utf-8">
<meta name="author" content="http://www.dbjr.com.cn/" />
<title>腳本之家</title>
<style type="text/css">
div{
  height:200px;
  width:200px;
  border:1px solid blue
}
.reset{
  font-size:20px;
  color:green;
}
</style>
<script type="text/javascript" src="mytest/jQuery/jquery-1.8.3.js"></script> 
<script type="text/javascript">
$(document).ready(function(){
  $("#btn").click(function(){
    $("div").removeAttr("class");
  })
})
</script>
</head>
<body>
  <div class="reset">腳本之家歡迎您</div>
  <button id="btn">點(diǎn)擊查看效果</button>
</body>
</html>

在以上代碼中,點(diǎn)擊按鈕可以刪除移除class屬性。

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

相關(guān)文章

最新評(píng)論