How can i dismiss a function which is set by settimeout
<p>here if user second time clicks on the    '#subject-class-switch the previous settimeout should dismiss how can i achive this</p>

<pre><code>$('#switchsubjects').click(function(e)
{
        i++;
        var x=$('#subject-class-switch').html();
        if(i&lt;2)
        {
            $(this).append('&lt;ul id="dcl"&gt;&lt;li class="ui-btn-inner ui-li"&gt;Class&lt;/li&gt;&lt;li class="ui-btn-inner ui-li"&gt;Subjects&lt;/li&gt;&lt;/ul&gt;');
            e.stopPropagation();
            setTimeout(rm(),10000);
        }
        else
        {
            $('#dcl').remove();
            i=0;
        }
});     

    function rm()
    {
    console.log("working");
    $('#dcl').remove();
    i=0;
    }
</code></pre>
