the problem is your text variable. you have to define it before concatenate with it. Basically you are trying to concatenate a string to a variable that does not exists. This will throw an error and your script won't work.
text+='some text';
is shorthand for text=text+'some text';
You notice that this will give problems when the text variable is not defined in your code.
function makeid(num){ // It doesn't work as the parameter isn't passed
text='';
var chooseLetters = "abcdefghijklmnopqrstuvwxyz";
var loopNum=num;
for( var i=0; i < loopNum; i++ ) // loopNum does not work!
text += chooseLetters.charAt(Math.floor(Math.random() * chooseLetters.length));
return text;
} // END function makeid();
working fiddle