i have a div like

<form method='post' action='send'><div id='fail' name='cool'>300</div><input type='submit' value='submit'></form>

now how would i call that into a variable in php? i tried


but it didnt work. help

how would i put a div value into a variable?

try this

<div id='fail' name='cool'>300</div>
<form method="post" action="send.php" name="form1">
<input type="hidden" name="field">
<input type='submit' value='submit' onclick="document.form1.field.value=document.getElementById('fail').innerHTML">

Test it!

<script language="javascript">
function send()
document.getElementById('div_content').value = document.getElementById('content').innerHTML;
        echo $_POST['div_content'];
    <form name="form1" action="" method="post">
        <input type="hidden" id="div_content" name="div_content" />
        <div id="content">this is test</div>
        <input type="button" onclick="send()" value="Send" />

By javascript I put div content ("innerHTML") into hidden tag!
And after that by javascript I send my from!