tiger66
07-03-2003, 08:35 PM
Hello
I am just wondering how can I use the variable in the onClick method which is outputting by javascript?
for example
function status1()
{
"<input type='radio' NAME='a' VALUE='AGC' onClick='status2(agc);' checked></td>"
}
function status2(type)
{
if(type=='agc'){
blah, blah...
}
}
I am getting a variable 'agc' undefined error message
I don't get it :(
when my onClick method is written in HTML like onClick="status2('agc')", it always recognized the variable 'agc'
I guess my question is when exactly do I need to use single quote and when do I need to use double quote?
Thanks for any help
I am just wondering how can I use the variable in the onClick method which is outputting by javascript?
for example
function status1()
{
"<input type='radio' NAME='a' VALUE='AGC' onClick='status2(agc);' checked></td>"
}
function status2(type)
{
if(type=='agc'){
blah, blah...
}
}
I am getting a variable 'agc' undefined error message
I don't get it :(
when my onClick method is written in HTML like onClick="status2('agc')", it always recognized the variable 'agc'
I guess my question is when exactly do I need to use single quote and when do I need to use double quote?
Thanks for any help