Remove attribute in Jquery

<!DOCTYPE html>
<html>
<head>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.12.2/jquery.min.js"></script>
<script>
$(document).ready(function(){
$("button").click(function(){
$("p").removeAttr("style");
});
});
</script>
</head>
<body><h1>This is a heading</h1>

<p style="font-size:120%;color:red">Coding 4 Developers</p>
<p style="font-weight:bold;color:blue">Running code website</p>

<button>Remove the style attribute from all p elements</button>

</body>
</html>

Share This:

Leave a Reply

Your email address will not be published. Required fields are marked *