How can we remove a element inside a string.

How can we remove a element inside a string.

 How can we remove a element inside a string.

For example,

HTML :

<div id="main">
<h2 class="first">This is a heading</h2>
<p class="first">This is a paragraph.</p>
<p>This is another paragraph.</p>
<div>This is another div  content.</div>
<button type="button">Click me</button>
</div>





JQuery:

var html = $('<div>').append($('#main').clone()).remove().html; 

after clone , i want to remove button element and also the element which has the class "first".

How can i do this ?