-1

I have the following html

<div class="outer">
    Some Text
    <div class="inner">
         .....
    </div>
</div>

How would I remove or change the "Some Text" without affecting the inner div?

Huangism
  • 16,278
  • 7
  • 48
  • 74
Nate
  • 510
  • 1
  • 4
  • 21

1 Answers1

1

You could use:

$('.inner').each(function (){
    this.parentNode.removeChild(this.previousSibling);
});
cookie monster
  • 10,671
  • 4
  • 31
  • 45
David Thomas
  • 249,100
  • 51
  • 377
  • 410
  • 1
    @cookie: thanks, one day I'll learn to stop using tablets/phones for code (or train the spell-check/autocorrect)... – David Thomas Aug 25 '14 at 19:45