[英]onclick funtion not working beacause it not in the main retun statement
[英]HTML onclick = retun confirm not working?
嘿,我正在尝试使用 onclick =return 确认,但是每当我单击该按钮时,都不会出现任何提示,它只会转到重定向。 我的前端开发并不是最好的。 任何帮助表示赞赏。 谢谢
<td><a href="delete.php?id='.$row["userID"].'" onclick="return confirm("Are you sure you want to delete ?")" class="waves-effect waves-light btn-small red lighten-1"><i class="material-icons">delete</i></a></td>
你可以试试这个...这是我这边的工作 请试试这个
echo "<a onClick="javascript: return confirm('Are You sure to delete this');" href='delete.php?id=".$res['id']."'>Delete";
如果您不使用引号将属性值括起来,则该值在第一个空格处结束。
你有:
onlick=return
您的第二个问题是您忘记了c
使用浏览器中的 Inspector 功能查看实际生成的属性是一种有用的调试技术,可以帮助您缩小此处的问题范围。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.