Switch case as string
<pre><code>$(document).ready(function(){

    createForm("text,password",".content");  

});

function createForm(types,object){

    typ = types.split(',');

    //var source = "";

    $.each(typ,function(){

        switch(this){

            case "text":
            console.log('text');break;
            default: console.log('default');break;
        }


    });
    //$(object).html(source);
}
</code></pre>

<p>I have this code an in console it return 2xdefaults. Why?</p>

<p>I try to return a input for each type as text or password but my switch does not recognize the "typ"</p>
