jQuery - add 2 buttons with parent().before() + parent.after() and use them later with .toggle()
<p>Here is how I did it</p>

<pre><code>//wrap a div arround the table
$(this).wrap('&lt;div class="table_space"&gt;&lt;div class="table_wrapper_div"&gt;
&lt;/div&gt;&lt;/div&gt;').parent().before('&lt;button class="my_button" &gt;
EXPANDIR&lt;/button&gt;').after('&lt;button class="my_button"&gt;EXPANDIR&lt;/button&gt;');
</code></pre>

<p>this = a very big table</p>

<pre><code>$('.my_button').toggle(
        function(){ 
            ... blablabla ...
    },
    function(){ 
        ... blabllaba ...
    }
);
</code></pre>

<p>But the toggle event is never triggered... now if I add the button directly in the html page then the toggle event is in this case triggered.
Any help will be great, I've looked for other questions but didn't find any clue.
Thanks a lot</p>

<p>EDIT: NB - the wrapping gives exactly what I need and puts the buttons between table_space and table_wrapper_div</p>
