简体   繁体   English

从onclick = function()获取按钮的内容

[英]Get the content of a button from onclick=function()

how can I access the content of a button? 如何访问按钮的内容?

HTML: HTML:

<form method="post">
    <button type="submit"  name="delete" class="btn btn-lg btn-danger" onclick="deleletconfig('.$test[0].')">delete</button>
</form>

and this is the PHP: 这是PHP:

if (isset($_POST['delete']))
    echo $_POST['delete'];

I need to have the result of "deleletconfig('.$test[0].')" in the php code. 我需要在php代码中获得"deleletconfig('.$test[0].')"的结果。

打开标签

onclick="deleletconfig('<?php echo $test[0]; ?>')"

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

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