Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Remove HTML tag and keep text

Is there a way to remove the HTML blockquote tag, but keep the text? Basically, if in my code was <blockquote>Hello!</blockquote>, I'd want it to display as Hello! - I don't know if there's a way to filter the blockquotes out or just clone the text, but an answer would be quite helpful!

like image 485
James Charless Dickinson Avatar asked Mar 04 '26 14:03

James Charless Dickinson


1 Answers

Use contents with unwrap:

$("blockquote").contents().unwrap();
like image 143
VisioN Avatar answered Mar 07 '26 05:03

VisioN



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!