-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
  • 15,899
  • 5
  • 47
  • 67
Nate
  • 500
  • 1
  • 4
  • 21

1 Answers1

1

You could use:

$('.inner').each(function (){
    this.parentNode.removeChild(this.previousSibling);
});
cookie monster
  • 10,261
  • 3
  • 30
  • 44
David Thomas
  • 240,457
  • 50
  • 366
  • 401
  • 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