For example:
<input type="text" size="5" id="question'+$qid+'"onKeyUp="checkanswer('+i+')"/></div>
I want to refer to the "question'+$qid+'" element inside the function checkanswer(), how to do it?
Maybe I can do it by onKeyUp="checkanswer('+$qid+')", is there other elegant way to do it?
Not sure I fully understand what you’re asking for, but if you’re trying to pass the current item to
checkanswer()you can just do: