Edit: Disregard this question, I had an issue passing my third parameter to my JS function, which happened to be the variable I was questioning Silly thread by me =\ Hello, seeing as how I'm not experienced with javascript syntax, I would like to know how to pass a variable as string in such a way below: function showUser(c) { document.getElementById("txtHint"); // document.getElementById(c); (I would like to use variable c in place of the ID name. I'm not sure of the proper syntax, though. } showUser(<?=$count?>); Code (markup): Any suggestions? thanks!
Hi, the only thing you need to do is to say JS, that the argument in your function is a string, using whatever quotes - showUser('<?=$count?>'); Without that, you're passing the value of php $count as a JS variable... Hope you see what I mean