0
<figure>
<p>Hello please remove parent figure tag. I just want the this child p tag.</p>

</figure>
2
  • <figure><p>keep p tag only remove figure tag using js.</p></figure> Commented Apr 7, 2020 at 3:19
  • Sometimes this might help you: stackoverflow.com/questions/2727717/… Commented Apr 7, 2020 at 3:41

1 Answer 1

1

This is the plain Javascript solution for your problem:

<html>
 <body>
  <figure id='x'><p id='y'>Hello</p></figure>

 <script type='text/javascript'>
   let a = document.getElementById('x').innerHTML;

   document.getElementById('x').remove();

   document.write(a);

  </script>
 </body>
</html>
Sign up to request clarification or add additional context in comments.

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.