How to remove element before?

How to remove element before?

Hi,
I need to remove H3 and DIV. Here is code:

  1. <myDIV>
  2. <h3 number=0></h3><!-- number automatically generate by ASP -->
  3. <problemDIV number=0><button here></problemDIV>
  4. <h3 number=1></h3>
  5. <problemDIV number=1></problemDIV>
  6. </myDIV>


In problemDIV I have delete button (for delete H3 and problemDIV) and click function has:


  1. $("#myDIV").remove( "h3[number=]"+$(this).attr("number"));//doesnt work
  2. $("#myDIV").remove( "problemDIV[number=]"+$(this).attr("number"));//doesnt work