JavaScript help: Simple script won't work when calling setTimeout
<p>I want to change the exist in a span element every 2 seconds, but it showing only what is in case 0: 'asd'.</p>

<p>Could anyone tell me why this is not working? </p>

<pre><code>var n = 0;

function hideVideoSpan(type){
    switch(type)
    {
        case 0:
        {
            $("#hideVideoSpan").html('asd');
            n = 1;
            break;
        }

        case 1:
        {
            $("#hideVideoSpan").html('lol');
            n = 0;
            break;
        }

        default:break;
    }

    setTimeout(hideVideoSpan(n), 2000);
}

hideVideoSpan(n);
</code></pre>
