首页 > 语言 > JavaScript > 正文

jQuery中removeAttr()方法用法实例

2024-05-06 14:48:03
字体:
来源:转载
供稿:网友

本文实例讲述了jQuery中removeAttr()方法用法。分享给大家供大家参考。具体分析如下:

此方法从匹配元素中移除相应的属性。

语法结构:
代码如下:$(selector).removeAttr(attribute)

参数列表:

参数 描述
attribute 定义要从匹配元素中移除的属性

实例代码:

代码如下:
<!DOCTYPE html>
<html>
<head>
<meta charset=" utf-8">
<meta name="author" content="//www.Vevb.com/" />
<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">

发表评论 共有条评论
用户名: 密码:
验证码: 匿名发表

图片精选