How to know when an input has changed its class
<p>I have function which is removing and adding class into input tag, i want to when we add or remove class then one function should alert that you have made changes.</p>

<pre><code>&lt;head&gt;
    &lt;script type="text/javascript"&gt;
        $(function() {
            $('a').click(function() {
                $('input').removeClass()
                var cl = $(this).attr('class')
                $('input').addClass(cl)
            })
        })

        function activitydone() {
            alert('class change')
        }
    &lt;/script&gt;

    &lt;style&gt;
        .first { border:solid 1px #F00 }
        .second { border:solid 1px #0F0 }
        .third { border:solid 1px #00F }
    &lt;/style&gt;
&lt;/head&gt;

&lt;body&gt;
    &lt;input type="text" onchange="activitydone()" /&gt;

    &lt;a href="#" class="first"&gt;first&lt;/a&gt;
    &lt;a href="#" class="second"&gt;second&lt;/a&gt;
    &lt;a href="#" class="third"&gt;third&lt;/a&gt;
&lt;/body&gt;
</code></pre>
