简体   繁体   English

html传递参数onclick事件

[英]html passing parameters onclick event

I'm new in js/php and need help for a question about passing parameters to js function from a onclic event in a tr tag 我是js / php的新手,并且需要有关从tr标记中的onclic事件向js函数传递参数的问题的帮助

echo "<tr onclick='DoNav({$row['id']})'>";

this code runs ok, but i need pass a second parameter: $row['name'] but my function DoNav() seems not receive it. 此代码可以正常运行,但是我需要传递第二个参数: $ row ['name'],但是我的函数DoNav()似乎没有收到它。 Thanks. 谢谢。

echo '<tr onclick="DoNav(' . $row['id'] . ')">';

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM