javascript/jQuery在方法中传递参数

javascript/jQuery在方法中传递参数,javascript,jquery,methods,arguments,Javascript,Jquery,Methods,Arguments,如何在此代码中传递参数 $table += "<td>" + "<a href='#' onclick='myFunction(HERE_I_need_to_pass_an_argument);'>" + items[i].senderID +"</a>" +"------"+ items[i].startTime +"</td>"; function myFunction (myVariable) { // my other logic go

如何在此代码中传递参数

$table += "<td>" + "<a href='#' onclick='myFunction(HERE_I_need_to_pass_an_argument);'>" + items[i].senderID +"</a>" +"------"+ items[i].startTime +"</td>";

function myFunction (myVariable) {
 // my other logic goes here
}
$table+='+'+'-“+items[i].startTime+”;
函数myFunction(myVariable){
//我的另一个逻辑是这样的
}
你能帮我写一个这样的警告吗:

alertValue = 10;
$table += "<td>" + "<a href='#' onclick='alert(alertValue );'>" + items[i].senderID +"</a>" +"------"+ items[i].startTime +"</td>";

function myFunction (myVariable) {
 // my other logic goes here
}
alertValue=10;
$table++=''++'----“+项[i].开始时间+”;
函数myFunction(myVariable){
//我的另一个逻辑是这样的
}
$table+=“+”+”----“+items[i].开始时间+”;

非常感谢,总是用引号和双引号括起来。。。啊。。。无论如何,这是一个巨大的感谢我会接受你的答案以后,SOF不允许我接受你的答案现在,说8分钟后:-)
$table += "<td>" + "<a href='#' onclick='alert("+alertValue+");'>" + items[i].senderID +"</a>" +"------"+ items[i].startTime +"</td>";