$(selector).removeAttr(attribute)
<!DOCTYPE html>
<html>
<head>
<title>
jQuery removeAttr() method
</title>
<script src="/ajax/libs/jquery/1.12.2/jquery.min.js"> </script>
<script>
$(document).ready(function() {
$("button").click(function() {
$("p").removeAttr("class");
});
});
</script>
<style>
.jtp {
color: red;
background-color: yellow;
border: 2px dashed blue;
font-size: 25px;
}
</style>
</head>
<body>
<h1>
Welcome to the bianchenghao6.com
</h1>
<h2>
Example of the jQuery removeAttr() Method
</h2>
<p id = "para" class = "jtp">
This is first paragraph element.
</p>
<p id = "para1" class = "jtp">
This is second paragraph element.
</p>
<p> Click the following button to see the effect. </p>
<button>
Click me
</button>
</body>
</html>
This is first paragraph element.
This is second paragraph element.
Click the following button to see the effect.
<!DOCTYPE html>
<html>
<head>
<title>
jQuery removeAttr() method
</title>
<script src="/ajax/libs/jquery/1.12.2/jquery.min.js"> </script>
<script>
$(document).ready(function() {
$("button").click(function() {
$("div").removeAttr("id class");
});
});
</script>
<style>
.jtp {
color: red;
font-size: 25px;
margin: 10px;
}
#d1{
border: 2px solid blue;
background-color: lightgreen;
}
#d2{
border: 2px dashed blue;
background-color: lightblue;
}
</style>
</head>
<body>
<h1>
Welcome to the bianchenghao6.com
</h1>
<h2>
Example of the jQuery removeAttr() Method
</h2>
<div id = "d1" class = "jtp">
This is first div element.
</div>
<div id = "d2" class = "jtp" >
This is second div element.
</div>
<p> Click the following button to see the effect. </p>
<button>
Click me
</button>
</body>
</html>
This is first paragraph element.
This is second paragraph element.
Click the following button to see the effect.