Get Element By Class and add/remove attribute in JavaScript - Javascript jQuery Method and Property

Javascript examples for jQuery Method and Property:removeAttr

Description

Get Element By Class and add/remove attribute in JavaScript

Demo Code

ResultView the demo in separate window

<html>
 <head> 
  <meta name="viewport" content="width=device-width, initial-scale=1"> 
  <script type="text/javascript" src="https://code.jquery.com/jquery-git.js"></script> 
  <script type="text/javascript">
    $(window).on('load', function() {
$(function(){// www .  j  a v a2 s.c  om
   $(".className").removeAttr("onclick style");
});
    });

      </script> 
 </head> 
 <body> 
  <span onclick="test" style="color:blue;" class="className">testing</span>  
 </body>
</html>

Related Tutorials