Send Email 以及如何将该代码-6ren">
gpt4 book ai didi

php - JavaScript onClick href

转载 作者:行者123 更新时间:2023-11-29 18:33:52 25 4
gpt4 key购买 nike

使用<a>标签,我可以这样写:

<a href="include/sendemail.php?id_user=<?= $_GET['id_user'];?>" onclick="return confirm('Are you sure want to send an email?');" >Send Email</a>

以及如何将该代码应用于按钮:

<input type="button" onclick="return confirm('Are you sure want to send an email?');"  value="Send Email" >

最佳答案

如果你想只做一点改变就可以实现你的目标,试试这样的方法:

<input type="button" onclick="if(confirm('Are you sure want to send an email?')) { document.location.href = 'include/sendemail.php?id_user='; } " value="Send Email" />

关于php - JavaScript onClick href,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/5297799/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com