-1
var html = html + "<tr>\n" + "<td style='text-align: center; background-color: #FFCE43;
'> </br>" + $(n).find("Julio").text() + " <img style = 'cursor: pointer;' onclick='myFunction('"+a+"')' src='add.png'></td> </tr>";
我想通過a作爲參數,但沒有成功,我遇到了「」,「'的組合的麻煩。如何將參數傳遞到JavaScript功能從生成的HTML
如果有什麼錯誤,你會得到什麼?看看你的控制檯輸出 – lumio
可能重複[通字符串參數在一個onclick功能(https://stackoverflow.com/questions/9643311/pass-string-parameter-in-an-onclick-function) – Kevin