javascript - How to use data created by JS in PHP? -
this code
<script type="text/javascript"> function countnumber(){ var number = 10; document.getelementbyid("n").innerhtml=number; } </script> <body onload="countnumber()"> <?php $a = "?"; //<-- here want innerhtml of "n"-id-element echo $a+1; ?> </body>
how access html-data @ initialization of $a?
you cannot access data way want, php runs on server, files transfered client , javascript runs on client. if need process data calculated javascript, need ajax or forms.
Comments
Post a Comment