$(document).ready(function(){
createForm("text,password",".content");
});
function createForm(types,object){
typ = types.split(',');
$.each(typ,function(){
switch(this){
case "text":
console.log('text');break;
default: console.log('default');break;
}
});
}
I have this code, and in the console it returns 2xdefaults. Why?
I am trying to return the input for each type as text or password, but my switch does not recognize "typ"
kraYz source
share