Switching between two images and two sentences
<p>I am creating an add and delete button, when you can add above the picture it says please add and when you can delete it says please delete. I am stuck however on how to be able to make it work. What I got works when you add but not when you delete:</p>

<pre><code>    $('.button a').click(function() {
        var url = $(this).attr('href');
        var info = $(this).attr('rel');
        var cct = $.cookie("&lt;?php echo $this-&gt;config-&gt;item('csrf_cookie_name'); ?&gt;");

        $.get(url, {&lt;?php echo $this-&gt;security-&gt;get_csrf_token_name(); ?&gt;: cct}, function() {
            $('.button a').empty().addClass('delete');
            $('.addText').empty().html(info);
        });
        return false;
    });
</code></pre>

<p>The html</p>

<pre><code>&lt;div class="addText"&gt;please add&lt;/div&gt;

&lt;div class="button"&gt;&lt;a href="cabinet/add/180" class="add" rel="please delete"&gt;&lt;/a&gt;&lt;/div&gt;
</code></pre>
