removing div from paragraph using jquery -


i have following problem:

i have :

<p class="site_text"><div>some text</div></p> 

i trying remove div tag , leave text intact, , have following code

$('p.site_text').remove('<div>'); $('p.site_text').remove('</div>'); 

which not remove div paragraph. can help?

regards, zoran

you cannot put div inside p tag, both violates html rules , doesn't work in chrome. if replace p div, can use following code:
jsfiddle: http://jsfiddle.net/ax3hp/1/
js:

$('div.site_text div').wrapinner('<span/>').children().unwrap(); 

html:

<div class="site_text"><div>some text</div></div> 

Comments

Popular posts from this blog

ios - iPhone/iPad different view orientations in different views , and apple approval process -

java Extracting Zip file -

C# WinForm - loading screen -