使用 post 方法 PHP 获取 innerHTML 值 [英] Take innerHTML value with post method PHP

查看:25
本文介绍了使用 post 方法 PHP 获取 innerHTML 值的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想使用 post 方法获取表单中标签元素的 innerHTML 值,并将其显示到另一个 PHP 页面.但我只与文本框一起使用,例如登录表单中的示例.有什么想法吗??

解决方案

您将需要使用隐藏输入:

这会将 label-value 添加到 post 哈希.

W3Schools

I want to take the innerHTML value of a label element in a form with method post and show it to another PHP page. But i have only work with that with textboxes, as an example in a login form. Any ideas??

<div id="menu" class="menu">
        <label class="" ></label>
        <label id="minutes">00</label>
        <label>:</label>
        <label id="seconds">00</label>
        <label id="" style="margin-left: 30px"></label>
        <label id="accuracyLetter" style="position:relative;">100%</label>
        <label id="" style="margin-left: 30px"></label>
        <label id="totalAccuracy">100%</label>
   </div>

解决方案

You will need to use a hidden input:

<input type="hidden" name="label-value" value="innerHTML"/>

This will add label-value to the post hash.

W3Schools

这篇关于使用 post 方法 PHP 获取 innerHTML 值的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆