我正在尝试将DIV的整个innerHtml
提取到一个PHP变量。将DIV的整个innerhtml设计存储到一个变量
为此,我所做的是将整个innerHtml
放到一个隐藏字段中,然后将隐藏字段调用到php中。
我的代码是:
<form method="post">
<div class="container" id="content">
<h1>Header1</h1>
<p>this is the para</p>
<textarea id="address" name="address"></textarea>
</div>
<input type="hidden" id="hidhtm" name="hidhtm"/>
</form>
在我的JS文件我有:。
的document.getElementById( 'hidhtm')值=的document.getElementById( '内容')的innerHTML;
在我的PHP我有:
$测试= $ _ POST [ 'hidhtm']; echo $ test;
任何人都可以请帮助我。
页面中是否有表单? – j08691 2015-02-05 18:43:31
@ j08691 ...是的,我有一个表单...我应该共享整个HTML? – 2015-02-05 18:48:31
其中是称为“内容”的元素?你期望的输出是什么,你会得到什么? – Loopo 2015-02-05 18:56:50