如何在此代码中传递参数
$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
}
你能帮我写一个这样的警报吗:
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
}