CodeLab
Show Output
 
 
 
1
<!DOCTYPE html>
2
<html lang="en">
3
<head>
4
<meta charset="utf-8">
5
<title>jQuery removeClass()</title>
6
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css" />
7
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.3.1/jquery.min.js"></script>
8
<style>
9
.highlight{font-size:18px;color:#11a286}
10
</style>
11
<script>
12
$(document).ready(function() {
13
  $("#button").click(function() {
14
     $("p").removeClass('highlight');
15
  });
16
});
17
</script>
18
</head>
19
<body>
20
 <p class="highlight">This is a paragraph.</p>
21
 <button style="margin:0 0 10px 0;background:#e8e8e8;" class="btn" id="button">Click here to remove class from p element</button><br />
22
 </body>
23
</html>                            
 

Share this example with Facebook, Twitter