I am trying to write an anchor tag in a for loop, and sending parameters to a function in onclick event.
Now the problem is that the function does not pass the parameter which is in a variable instead it is getting an error "Uncaught ReferenceError: I is not defined ", where I is the value in the variable catidone.
catlisttxt += '<li>'+catidone+'<a href="#" onclick="return DisplayQues('+ catidone +')">'+data.categories[i].maincatname+'</a></li>';
onclickattributes. It makes life easier.