How to Remove Anchor tag Link from Div Using jQuery

In this tutorial, learn how jQuery remove anchor tag link from div on button click. The Short answer is: use the find() to find the anchor link and unwrap() to remove anchor tag link on click of the button.

The link contains some text and is inside the div element. You can remove the anchor tag from the text and the text is not changed. You have to first find the anchor tag using the find().

The content() find the content inside the anchor tag and the unwrap() remove the anchor tag from the content.

How jQuery Remove Anchor Tag Link to Disable

To perform this task on click of the button, you have to use the jQuery click event. You have to use the jQuery selectors to access the button element for click event and find the anchor link using the find().

You have to use find(), contents() and unwrap() together to jQuery remove anchor tag link.

Output


The above example contains the two links and a button. Click the link given above to jQuery remove anchor tag link and the text remains present there with no anchor link with it.

I hope, you like the tutorial on how to jQuery remove anchor tag link from div using jQuery. If you have any queries regarding this tutorial, please comment below.