php生成的按钮中的JavaScript

JavaScript in a php generated button

本文关键字:JavaScript 按钮 php      更新时间:2023-09-26

下面的代码打印一个按钮,如图所示。除IE外,所有浏览器都可以使用这些按钮。我如何在上面添加javascript?

print "<td>" ."<a href='advancedview.php?id=$uniqueid' STYLE='text-decoration: none'><input type='Button' value='More Details' style='width:100%;height:30%'> </a>". "</td>";

我试过了。。。onClick='advancedview.php?id=$uniqueid',但它不起作用,例如。感谢

按钮onclick事件解析javascript,因此如果您想更改window.location 的位置

echo "<td><input type='"Button'" onclick='"window.location='advancedview.php?id=".$uniqueid."''" value='"More Details'" style='"width:100%;height:30%'"></td>";