Beginners question: Variable in Javascript
- by Andreas
Hello everybody!
I'm new to javascript and cant get this little thing to work. (all external scripts a of course loaded)
I have this jQuery script:
$('a.Link').click(function(){
autoComp('City');
});
function autoComp(strFormName) {
var Company = 'Adobe Apple Microsoft'.split(" ");
var City = 'London Paris Berlin'.split(" ");
$('#'+strFormName).autocomplete(strFormName)
}
I cant get it to work. I've discovered that the problem is the last "strFormName" after .autocomplete
Appreciate all the help I can get.