Here we are going to explain what is removeAttr() function or how to use removeAttr() function or why use removeAttr() function or how to remove attribute of the selected elements  in jQuery with example.


The jQuery removeAttr() function is used to remove attribute of the selected html elements.   


To remove an attribute:



  • Example of jQuery removeAttr() function

Let's see an example to of jQuery removeAttr() function.

<!DOCTYPE html>
<html xmlns="">
    <title>jquery removeAttr tutorial</title>
    <script src="Scripts/jquery-1.8.2.min.js"></script>
    <script type="text/javascript">
        $(document).ready(function () {
            $("button").click(function () {
    <p style="background-color:yellow;">SQL Tutorials Point</p>
    <button>Remove style attribute</button>


 As shown in the above program, when user click on button then remove the style attribute of p element.


Use jQuery removeAttr() function

I hope it will help to you.


 Let's check live example

Leave a comment

Make sure you enter the (*) required information where indicated. HTML code is not allowed.

You may also like