Remove P with Jquery

Asked

Viewed 64 times

2

I have a part of the site that is manageable, and this manager creates a <p> automatically. I don’t want this <p>. How do I remove only the tag <p> without the content inside.

<li class="margin-bottom-8">
  <img src="images/iconPhoneGreen.png" class="margin-left-2 margin-right-7"><p>descricaoSYS</p>
</li>

1 answer

5


  • 1

    +1. I was not aware of this function.

  • 1

    +1, also did not know.

  • I went to test and it didn’t work =/

  • 1

    @Felipestoker It’s something thus that you want?

  • @Exact qmechanic73, only it didn’t work on me oo. https://jsfiddle.net/felipestoker/kkhsLz11/ in this case, the P automatically goes inside <span>descricaoSYS</span>. I guess I have to create a class because I can’t remove all the p of the site.

  • @Felipestoker On the jQuery page (http://api.jquery.com/unwrap/) there is an example that removes the tag p if you are only related to a div see if it’s something like what you want to do.

  • is similar yes, but do not know why here n works

  • 1

    @Felipestoker has succeeded?

Show 3 more comments

Browser other questions tagged

You are not signed in. Login or sign up in order to post.